|
Public Types |
enum | { MAX_KEY_LENGTH = 512
} |
Public Member Functions |
| Keyfile () |
| initialize to empty
|
void | put (const char *key, const void *value, int valueSize) |
void | put (int key, const void *value, int valueSize) |
bool | get (const char *key, void *value, int &actualSize, int maxSize) const |
bool | get (const char *key, char **value, int &actualSize) const |
bool | get (int key, void *value, int &actualSize, int maxSize) const |
bool | get (int key, char **value, int &actualSize) const |
bool | next (char *key, int &keyLength, char *value, int &valueLength) |
bool | next (int &key, char *value, int &valueLength) |
bool | previous (char *key, int &keyLength, char *value, int &valueLength) |
bool | previous (int &key, char *value, int &valueLength) |
int | getSize (const char *key) const |
int | getSize (int key) const |
void | remove (const char *key) |
| Remove the entry in the b-tree for the given key.
|
void | remove (int key) |
| Remove the entry in the b-tree for the given key.
|
void | open (const std::string &filename, int cacheSize=1024 *1024, bool readOnly=false) |
| Open a keyfile with the given filename, with cacheSize (default 1MB).
|
void | open (const char *filename, int cacheSize=1024 *1024, bool readOnly=false) |
| Open a keyfile with the given filename, with cacheSize (default 1MB).
|
void | openRead (const std::string &filename, int cacheSize=1024 *1024) |
void | create (const std::string &filename, int cacheSize=1024 *1024) |
| Create a keyfile with the given filename, with cacheSize (default 1MB).
|
void | create (const char *filename, int cacheSize=1024 *1024) |
| Create a keyfile with the given filename, with cacheSize (default 1MB).
|
void | close () |
| Close a keyfile.
|
void | setFirst () |
| Initialize keyfile to first key for iteration.
|
bool | getNext (int &key, void *value, int &actualSize, int maxSize) const |
| get the next key and value pair from the keyfile.
|
bool | getNext (char *key, int maxKeySize, void *value, int &actualSize, int maxSize) const |
| get the next key and value pair from the keyfile.
|
bool | getNext (char *key, int &actKeySize, int maxKeySize, void *value, int &actualSize, int maxSize) const |
Private Member Functions |
void | _buildHandle (int cacheSize) |
void | _createKey (char *keyBuf, int number) const |
int | _decodeKey (char *keyBuf) const |
Private Attributes |
char * | _handle |
int | _handleSize |