Class handling SQLite database operations. More...
Inherits SQLite::RefObj.
Public Member Functions | |
RealDB (LPCTSTR pFilename) | |
Database object constructor. | |
bool | IsOpen () const |
Tests if this object has an open database. | |
sqlite3 * | GetSQLiteDB () const |
bool | Open (LPCTSTR pFilename) |
Open a database file. | |
bool | Close () |
Close the currently open database file. | |
bool | Execute (LPCTSTR pSQL) |
Runs an SQL statement on the open database. | |
bool | Execute (const std::tstring &sSQL) |
Runs an SQL statement on the open database. | |
sqlite_int64 | GetLastInsertRowid () const |
Retrieves the ID of the last row inserted into the database. | |
std::tstring | GetLastError () |
Retrieves the description of the last error that occured while working with the database. | |
Protected Member Functions | |
virtual | ~RealDB () |
Protected Attributes | |
sqlite3 * | m_pDB |
Pointer to the SQLite database structure. |
Class handling SQLite database operations.
Definition at line 357 of file SQLiteDB.cpp.
SQLite::RealDB::RealDB | ( | LPCTSTR | pFilename | ) | [inline] |
Database object constructor.
pFilename | Path of database file to open, or NULL not to open |
Definition at line 365 of file SQLiteDB.cpp.
References Open().
virtual SQLite::RealDB::~RealDB | ( | ) | [inline, protected, virtual] |
bool SQLite::RealDB::Close | ( | ) | [inline] |
Close the currently open database file.
Definition at line 401 of file SQLiteDB.cpp.
References IsOpen(), and m_pDB.
Referenced by SQLite::DB::Close(), Open(), and ~RealDB().
bool SQLite::RealDB::Execute | ( | const std::tstring & | sSQL | ) | [inline] |
Runs an SQL statement on the open database.
sSQL | The SQL statement to run |
Definition at line 413 of file SQLiteDB.cpp.
References IsOpen(), m_pDB, and MakeAnsiString().
bool SQLite::RealDB::Execute | ( | LPCTSTR | pSQL | ) | [inline] |
Runs an SQL statement on the open database.
pSQL | The SQL statement to run |
Definition at line 407 of file SQLiteDB.cpp.
References Execute(), and MakeTString().
Referenced by SQLite::DB::Execute(), and Execute().
std::tstring SQLite::RealDB::GetLastError | ( | ) | [inline] |
Retrieves the description of the last error that occured while working with the database.
Definition at line 425 of file SQLiteDB.cpp.
References m_pDB, and MakeTString().
Referenced by SQLite::DB::GetLastError(), and SQLite::RealStatement::RealStatement().
sqlite_int64 SQLite::RealDB::GetLastInsertRowid | ( | ) | const [inline] |
Retrieves the ID of the last row inserted into the database.
Definition at line 419 of file SQLiteDB.cpp.
References IsOpen(), and m_pDB.
Referenced by SQLite::DB::GetLastInsertRowid().
sqlite3* SQLite::RealDB::GetSQLiteDB | ( | ) | const [inline] |
Definition at line 387 of file SQLiteDB.cpp.
References m_pDB.
Referenced by SQLite::DB::Query(), and SQLite::RealStatement::RealStatement().
bool SQLite::RealDB::IsOpen | ( | ) | const [inline] |
Tests if this object has an open database.
Definition at line 383 of file SQLiteDB.cpp.
References m_pDB.
Referenced by Close(), Execute(), GetLastInsertRowid(), SQLite::DB::IsOpen(), and Open().
bool SQLite::RealDB::Open | ( | LPCTSTR | pFilename | ) | [inline] |
Open a database file.
pFilename | Path to file to open (or create) |
Definition at line 396 of file SQLiteDB.cpp.
References Close(), IsOpen(), m_pDB, and MakeAnsiString().
Referenced by SQLite::DB::Open(), and RealDB().