QNLP
v1.0
|
#include <db_helper.hpp>
Public Member Functions | |
DBHelper () | |
DBHelper (const std::string filename) | |
~DBHelper () | |
int | openDB (const std::string filename) |
Opens the requested database, and gives the return code of the operation. If the DB pointer has already been associated with data, then the return code is 0, and no operation is performed. More... | |
void | closeDB () |
Closes the database if the DB pointer is open. More... | |
sqlite3 * | getDBRef () |
Returns a pointer to the DB object. More... | |
std::string | getFilename () |
Get the name of the opened database. More... | |
Private Attributes | |
sqlite3 * | db_ptr |
std::string | db_filename |
Definition at line 35 of file db_helper.hpp.
DBHelper::DBHelper | ( | ) |
Definition at line 13 of file db_helper.cpp.
DBHelper::DBHelper | ( | const std::string | filename | ) |
Definition at line 15 of file db_helper.cpp.
References openDB(), and SQL_RETURN_CHECK.
DBHelper::~DBHelper | ( | ) |
Definition at line 19 of file db_helper.cpp.
References closeDB().
void DBHelper::closeDB | ( | ) |
Closes the database if the DB pointer is open.
Definition at line 23 of file db_helper.cpp.
References db_filename, db_ptr, and SQL_RETURN_CHECK.
Referenced by openDB(), TEST_CASE(), and ~DBHelper().
sqlite3 * DBHelper::getDBRef | ( | ) |
Returns a pointer to the DB object.
Definition at line 47 of file db_helper.cpp.
References db_ptr.
Referenced by TEST_CASE().
std::string DBHelper::getFilename | ( | ) |
Get the name of the opened database.
Definition at line 51 of file db_helper.cpp.
References db_filename.
Referenced by TEST_CASE().
int DBHelper::openDB | ( | const std::string | filename | ) |
Opens the requested database, and gives the return code of the operation. If the DB pointer has already been associated with data, then the return code is 0, and no operation is performed.
string | Path to database on filesystem. |
Definition at line 32 of file db_helper.cpp.
References closeDB(), db_filename, and db_ptr.
Referenced by DBHelper(), QNLP::CorpusUtils::loadData(), and TEST_CASE().
|
private |
Definition at line 72 of file db_helper.hpp.
Referenced by closeDB(), getFilename(), and openDB().
|
private |
Definition at line 71 of file db_helper.hpp.
Referenced by closeDB(), getDBRef(), and openDB().