|
Public Member Functions |
| TDBFile (const std::string &filename) |
| Create a new TDBFile.
|
virtual | ~TDBFile () |
const std::string & | filename () const |
| Get the file name.
|
void | open (int tdb_flags, int open_flags, mode_t mode=0666) |
| Open the file.
|
bool | has (const std::string &key) const |
| Returns true if the database contains the given key.
|
bool | getGeneric (const std::string &key, void *buf, unsigned int size) const |
| Generic way of retrieving the value for a key.
|
template<class ITEM> |
bool | get (const std::string &key, ITEM &item) const |
| Get the value of a key.
|
OpSet< std::string > | getStringSet (const std::string &key) const |
| Get the value of a key, parsed as a set of strings.
|
void | setGeneric (const std::string &key, const void *buf, unsigned int size) |
| Generic way of setting the value for a key.
|
template<class ITEM> |
void | set (const std::string &key, const ITEM &item) |
| Set the value of a key.
|
void | setStringSet (const std::string &key, OpSet< std::string > vals) |
| Set the value of a key using a set of strings.
|
void | remove (const std::string &key) |
| Remove an item.
|
int | traverse (int(*fn)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *), void *state) const |
| Iterate through all the items in the database.
|
|
const TDB_CONTEXT * | context () const |
| Access the internal TDB context.
|
TDB_CONTEXT * | context () |
| Access the internal TDB context.
|
Static Public Member Functions |
static OpSet< std::string > | deserialize_stringset (const TDB_DATA &val) |
| Utility function to deserialize a string list.
|
Protected Attributes |
TDB_CONTEXT * | db |
std::string | _filename |