Class to wrap a berkeley DB database and unify access. More...
#include <database.h>
Public Member Functions | |
database () | |
constructor | |
~database () | |
destructor | |
void | open_database (const std::string &) |
Open a BerkeleyDB file and link it to the database object. | |
void | close_database () |
close the database. | |
std::string | access_database (const std::string &) |
search for a string key in the DB, return associated string data. | |
Private Attributes | |
bool | usingDB |
remember if we are using a DB dictionary or a RAM one. | |
std::map< std::string, std::string > | dbmap |
dictionary loaded into RAM (if no DB is used) |
Class to wrap a berkeley DB database and unify access.
All databases in Freeling use a string key to index string data.
database::database | ( | ) |
constructor
Create a database accessing module.
database::~database | ( | ) |
destructor
Destructor.
std::string database::access_database | ( | const std::string & | ) |
search for a string key in the DB, return associated string data.
Referenced by dictionary::search_form().
void database::close_database | ( | ) |
close the database.
References ERROR_CRASH, and usingDB.
Referenced by dictionary::~dictionary(), and semanticDB::~semanticDB().
void database::open_database | ( | const std::string & | ) |
Open a BerkeleyDB file and link it to the database object.
Referenced by dictionary::dictionary(), and semanticDB::semanticDB().
std::map<std::string,std::string> database::dbmap [private] |
dictionary loaded into RAM (if no DB is used)
bool database::usingDB [private] |
remember if we are using a DB dictionary or a RAM one.
Referenced by close_database().