Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Keyfile Class Reference

#include <Keyfile.hpp>

List of all members.

Public Types

enum  { MAX_KEY_LENGTH = 512 }

Public Methods

 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


Detailed Description

Provides C++ interface to the keyfile b-tree package. Arbitrary data can be stored using either int or char * keys.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
MAX_KEY_LENGTH  Maximum length of any key in a keyfile.


Constructor & Destructor Documentation

Keyfile::Keyfile   [inline]
 

initialize to empty


Member Function Documentation

void Keyfile::close  
 

Close a keyfile.

void Keyfile::create const char *    filename,
int    cacheSize = 1024 *1024
 

Create a keyfile with the given filename, with cacheSize (default 1MB).

void Keyfile::create const std::string &    filename,
int    cacheSize = 1024 *1024
 

Create a keyfile with the given filename, with cacheSize (default 1MB).

bool Keyfile::get int    key,
char **    value,
int &    actualSize
const
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

bool Keyfile::get int    key,
void *    value,
int &    actualSize,
int    maxSize
const
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

bool Keyfile::get const char *    key,
char **    value,
int &    actualSize
const
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

bool Keyfile::get const char *    key,
void *    value,
int &    actualSize,
int    maxSize
const
 

Retrieve the value in the b-tree for the given key. Returns false if key does not exist in the b-tree.

bool Keyfile::getNext char *    key,
int &    actKeySize,
int    maxKeySize,
void *    value,
int &    actualSize,
int    maxSize
const
 

get the next key and value pair from the keyfile. return size of key in actKeySize

bool Keyfile::getNext char *    key,
int    maxKeySize,
void *    value,
int &    actualSize,
int    maxSize
const
 

get the next key and value pair from the keyfile.

bool Keyfile::getNext int &    key,
void *    value,
int &    actualSize,
int    maxSize
const
 

get the next key and value pair from the keyfile.

int Keyfile::getSize int    key const
 

Return the size of the data in the b-tree for the given key. Returns -1 if key does not exist in the b-tree.

int Keyfile::getSize const char *    key const
 

Return the size of the data in the b-tree for the given key. Returns -1 if key does not exist in the b-tree.

bool Keyfile::next int &    key,
char *    value,
int &    valueLength
 

bool Keyfile::next char *    key,
int &    keyLength,
char *    value,
int &    valueLength
 

void Keyfile::open const char *    filename,
int    cacheSize = 1024 *1024,
bool    readOnly = false
 

Open a keyfile with the given filename, with cacheSize (default 1MB).

void Keyfile::open const std::string &    filename,
int    cacheSize = 1024 *1024,
bool    readOnly = false
 

Open a keyfile with the given filename, with cacheSize (default 1MB).

void Keyfile::openRead const std::string &    filename,
int    cacheSize = 1024 *1024
 

bool Keyfile::previous int &    key,
char *    value,
int &    valueLength
 

bool Keyfile::previous char *    key,
int &    keyLength,
char *    value,
int &    valueLength
 

void Keyfile::put int    key,
const void *    value,
int    valueSize
 

Insert value into b-tree for the given key. Throws an Exception if the operation fails.

void Keyfile::put const char *    key,
const void *    value,
int    valueSize
 

Insert value into b-tree for the given key. Throws an Exception if the operation fails.

void Keyfile::remove int    key
 

Remove the entry in the b-tree for the given key.

void Keyfile::remove const char *    key
 

Remove the entry in the b-tree for the given key.

void Keyfile::setFirst  
 

Initialize keyfile to first key for iteration.


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 12:59:43 2004 for Lemur Toolkit by doxygen1.2.18