-
Notifications
You must be signed in to change notification settings - Fork 0
/
graphy.h
83 lines (75 loc) · 2.54 KB
/
graphy.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#ifndef GRAPHY_H
#define GRAPHY_H
#include <string>
#include <locale>
#include <algorithm>
#ifndef DATABASE_CPP
#define DATABASE_CPP
#include "database/database.h"
#endif
#ifndef PARSER_CPP
#define PARSER_CPP
#include "parser.cpp"
#endif
#ifndef Utils_H
#define Utils_H
#include "utils.h"
#endif
#define ERR_NUM_OF_ARGS "ERR incorrect number of arguments"
#define ERR_UNKNOWN_COMMAND "ERR unknown command"
#define ERR_OUT_OF_RANGE "ERR out of range"
#define ERR_NO_SUCH_KEY "ERR no such key"
class Graphy
{
public:
Database* db;
bool debug;
Graphy(bool d = false);
string command(string c);
string to_lower(string s);
string echo(string s);
string randomkey(string s, Database* db);
string get(string s, Database* db);
string set(string s, Database* db, bool* debug);
string getset(string s, Database* db, bool* debug);
string mset(string s, Database* db, bool* debug);
string mget(string s, Database* db, bool* debug);
string rename(string s, Database* db);
string renamenx(string s, Database* db);
string exists(string s, Database* db);
string del(string s, Database* db);
string sadd(string s, Database* db);
string sismember(string s, Database* db);
string scard(string s, Database* db);
string smembers(string s, Database* db);
string save(string s, Database* db, bool* debug);
string dbsize(string s, Database* db, bool* debug);
string incr(string s, Database* db);
string incrby(string s, Database* db);
string decr(string s, Database* db);
string decrby(string s, Database* db);
string sinter(string s, Database* db);
string sinterstore(string s, Database* db);
string sdiff(string s, Database* db);
string sdiffstore(string s, Database* db);
string spop(string s, Database* db);
string srem(string s, Database* db);
string srandmember(string s, Database* db);
string smove(string s, Database* db);
string sunion(string s, Database* db);
string sunionstore(string s, Database* db);
string flushdb(Database* db);
string lpush(string s, Database* db);
string lrange(string s, Database* db);
string rpush(string s, Database* db);
string llen(string s, Database* db);
string lrem(string s, Database* db);
string lset(string s, Database* db);
string lpop(string s, Database* db);
string rpop(string s, Database* db);
string lindex(string s, Database* db);
string ltrim(string s, Database* db);
string getrange(string s, Database* db);
string keys(string s, Database* db);
};
#endif // GRAPHY_H