SQLite::RealDB Class Reference

Class handling SQLite database operations. More...

Inherits SQLite::RefObj.

Collaboration diagram for SQLite::RealDB:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

Class handling SQLite database operations.

Definition at line 357 of file SQLiteDB.cpp.


Constructor & Destructor Documentation

SQLite::RealDB::RealDB ( LPCTSTR  pFilename  )  [inline]

Database object constructor.

Parameters:
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]

Destructor

Definition at line 370 of file SQLiteDB.cpp.

References Close().


Member Function Documentation

bool SQLite::RealDB::Close (  )  [inline]

Close the currently open database file.

Returns:
true if closed successfully, false if failed

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.

Parameters:
sSQL The SQL statement to run
Returns:
true if run successfully, false if failed

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.

Parameters:
pSQL The SQL statement to run
Returns:
true if run successfully, false if failed

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.

Returns:
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.

Returns:
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]
Returns:
Retrieves the internal SQLite database object

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.

Returns:
true if the object has an open database, false if not

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.

Parameters:
pFilename Path to file to open (or create)
Returns:
true if the database file was opened successfully, false if failed

Definition at line 396 of file SQLiteDB.cpp.

References Close(), IsOpen(), m_pDB, and MakeAnsiString().

Referenced by SQLite::DB::Open(), and RealDB().


The documentation for this class was generated from the following file:

Generated on Mon Jun 18 12:40:50 2012 for CC PDF Converter by doxygen 1.6.1