forked from uroni/urbackup_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DBSettingsReader.h
37 lines (26 loc) · 983 Bytes
/
DBSettingsReader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class IDatabase;
class IQuery;
class CDBSettingsReader : public CSettingsReader
{
public:
CDBSettingsReader(THREAD_ID tid, DATABASE_ID did, const std::string &pTable, const std::string &pSQL="");
CDBSettingsReader(IDatabase *pDB, const std::string &pTable, const std::string &pSQL="");
~CDBSettingsReader();
bool getValue(std::string key, std::string *value);
std::vector<std::string> getKeys();
private:
std::string table;
IDatabase* db;
IQuery *query;
};
class CDBMemSettingsReader : public CSettingsReader
{
public:
CDBMemSettingsReader(THREAD_ID tid, DATABASE_ID did, const std::string &pTable, const std::string &pSQL = "");
CDBMemSettingsReader(IDatabase *pDB, const std::string &pTable, const std::string &pSQL = "");
bool getValue(std::string key, std::string *value);
std::vector<std::string> getKeys();
private:
void init(IDatabase *pDB, const std::string &pTable, const std::string &pSQL);
str_map table;
};