database Class Reference

Class to wrap a berkeley DB database and unify access. More...

#include <database.h>

List of all members.

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)

Detailed Description

Class to wrap a berkeley DB database and unify access.

All databases in Freeling use a string key to index string data.


Constructor & Destructor Documentation

database::database (  ) 

constructor

Create a database accessing module.

database::~database (  ) 

destructor

Destructor.


Member Function Documentation

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().


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Tue Jul 27 16:29:31 2010 for FreeLing by  doxygen 1.6.3