Line | |
---|
1 | #ifndef FLATFILE_POOL_H |
---|
2 | #define FLATFILE_POOL_H |
---|
3 | #include "stopos_pool.h" |
---|
4 | #include "stopos_key.h" |
---|
5 | #include "stopos.h" |
---|
6 | |
---|
7 | class flatstatusrecord: statusrecord |
---|
8 | { |
---|
9 | longuint nextd; |
---|
10 | }; |
---|
11 | |
---|
12 | class flatfile_pool: public stopos_pool |
---|
13 | { |
---|
14 | private: |
---|
15 | int ff; // handle of file to be used |
---|
16 | |
---|
17 | int get_record(std::string &r, const std::string &k, const std::string &l); |
---|
18 | int put_record(const std::string &r, const std::string &k,const std::string &l); |
---|
19 | int remove_record(const stopos_key &k); |
---|
20 | int write_string(const std::string &r,off_t p); |
---|
21 | int read_string(std::string &r,off_t p); |
---|
22 | |
---|
23 | const static int STATUSTOOLONG = 101; |
---|
24 | |
---|
25 | const static char deleted = 'd'; |
---|
26 | const static char exists = '_'; |
---|
27 | |
---|
28 | std::string get_slot(const std::string &k); |
---|
29 | off_t strtoloc(const std::string &k); |
---|
30 | |
---|
31 | public: |
---|
32 | flatfile_pool(); |
---|
33 | int create_db(const std::string &dbname); |
---|
34 | int purge_db(void); |
---|
35 | int open_db(void); |
---|
36 | int close_db(void); |
---|
37 | void dump_db(void); |
---|
38 | }; |
---|
39 | |
---|
40 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.