|
| DBInterface (const std::string &host, const std::string &database, const std::string &user, const std::string &password, int port) |
|
virtual void | connect ()=0 |
|
virtual bool | isConnected ()=0 |
|
virtual void | execute_imp (const char *command)=0 |
|
void | execute (const char *command,...) |
|
void | execute (const std::string &command) |
|
virtual void | close ()=0 |
|
virtual void | clear ()=0 |
|
virtual DBRecordList | loadRecords ()=0 |
|
virtual bool | checkTable (const std::string &tablename)=0 |
|
virtual DBFieldTypeList | getTableContents (const std::string &tablename)=0 |
|
void | clearRecords () |
|
DBRecordList & | getRecords () |
|
const std::string & | getHostName () const |
|
const std::string & | getDatabase () const |
|
const std::string & | getUserName () const |
|
const std::string & | getPassword () const |
|
int | getPort () const |
|
|
void | init (const std::string &host, const std::string &database, const std::string &user, const std::string &password, int port) |
|
Definition at line 26 of file DBInterface.h.
◆ DBInterface() [1/2]
DBInterface |
( |
const std::string & |
host, |
|
|
const std::string & |
database, |
|
|
const std::string & |
user, |
|
|
const std::string & |
password, |
|
|
int |
port |
|
) |
| |
Definition at line 19 of file DBInterface.cc.
23{
24 init(host, database, user, password, port);
25}
◆ ~DBInterface()
◆ DBInterface() [2/2]
◆ clearRecords()
◆ execute() [1/2]
void execute |
( |
const char * |
command, |
|
|
|
... |
|
) |
| |
Definition at line 45 of file DBInterface.cc.
46{
47 StringList s;
48
49 {
51
52 va_list ap;
53 va_start(ap, text);
54 vsnprintf(m_buf, m_buf_size, text, ap);
55 va_end(ap);
56
57
58 s = StringUtil::split(m_buf, ';');
59 }
60
61 for (size_t i = 0; i < s.size(); i++)
62 execute_imp(s[i].c_str());
63}
Lock Guard for a Mutex instance.
◆ execute() [2/2]
void execute |
( |
const std::string & |
command | ) |
|
Definition at line 65 of file DBInterface.cc.
66{
67
68 StringList s = StringUtil::split(text, ';');
69 for (size_t i = 0; i < s.size(); i++)
70 execute_imp(s[i].c_str());
71}
◆ getDatabase()
const std::string & getDatabase |
( |
| ) |
const |
|
inline |
◆ getHostName()
const std::string & getHostName |
( |
| ) |
const |
|
inline |
◆ getPassword()
const std::string & getPassword |
( |
| ) |
const |
|
inline |
◆ getPort()
◆ getRecords()
DBRecordList & getRecords |
( |
| ) |
|
|
inline |
◆ getUserName()
const std::string & getUserName |
( |
| ) |
const |
|
inline |
◆ init()
void init |
( |
const std::string & |
host, |
|
|
const std::string & |
database, |
|
|
const std::string & |
user, |
|
|
const std::string & |
password, |
|
|
int |
port |
|
) |
| |
|
protected |
Definition at line 32 of file DBInterface.cc.
36{
37 m_host = host;
38 m_database = database;
39 m_user = user;
40 m_password = password;
41 m_port = port;
42 m_buf = new char[m_buf_size];
43}
◆ m_buf
◆ m_buf_size
const int m_buf_size = 1024 * 1000 |
|
staticprivate |
◆ m_database
◆ m_host
◆ m_mutex
◆ m_password
◆ m_port
◆ m_record_v
◆ m_user
The documentation for this class was generated from the following files: