-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmemdb.h
More file actions
45 lines (32 loc) · 870 Bytes
/
Copy pathmemdb.h
File metadata and controls
45 lines (32 loc) · 870 Bytes
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
38
39
40
41
42
43
44
45
#ifndef _MEMDB_
#define _MEMDB_
#include <stdio.h>
#include <stdlib.h>
#include <map>
#include <string>
class MemDB
{
public :
static MemDB * instance;
static MemDB *getInstance()
{
if( instance == NULL )
instance = new MemDB();
return instance;
};
void reset();
bool getBoolValue(std::string key, bool d = false);
int getIntValue(std::string key, int d = 0);
float getFloatValue(std::string key, float d = 0.f);
std::string getValue(std::string key);
void setValue(std::string key, int value);
void setValue(std::string key, float value);
void setValue(std::string key, std::string value);
private :
std::string getvalue(std::string key);
void setvalue(std::string key, std::string value);
MemDB();
~MemDB();
std::map<std::string, std::string> keyvalue;
};
#endif