Class handling an SQLite record set (read only!). More...
Inherits SQLite::RefObj.
Public Member Functions | |
Realset (sqlite3 *pDB, LPCTSTR pSQL) | |
Constructor from an SQL statement. | |
Realset (RealStatement *pStatement) | |
Constructor of record set by stepping through the statement and retrieving all the records. | |
int | GetColumn (const std::tstring &sName) const |
RealRecord * | GetRecord (int nNum) const |
Retrieves a record by index. | |
int | GetRecordCount () const |
Retrieves the number of records in the set. | |
bool | IsValid () const |
Tests if this records set is valid. | |
int | GetColumnCount () const |
Retrieves the number of fields in the record set. | |
std::tstring | GetColumnName (int nNum) const |
Retrieves the name of the field with the specified ordinal. | |
Protected Types | |
typedef std::vector< RealRecord * > | RECORDARRAY |
Array of SQLite records definion. | |
Protected Member Functions | |
~Realset () | |
Protected Attributes | |
STR2INT | m_mColumns |
Map of column names to ordinals. | |
RECORDARRAY | m_arRecords |
Array of records. | |
bool | m_bValid |
Flag of recordset validity. |
Class handling an SQLite record set (read only!).
Definition at line 66 of file SQLiteDB.cpp.
SQLite::Realset::Realset | ( | sqlite3 * | pDB, | |
LPCTSTR | pSQL | |||
) | [inline] |
Constructor from an SQL statement.
pDB | The database to retrieve the query results from | |
pSQL | The statement to run |
Definition at line 75 of file SQLiteDB.cpp.
References IsValid(), m_bValid, and MakeAnsiString().
SQLite::Realset::Realset | ( | RealStatement * | pStatement | ) |
Constructor of record set by stepping through the statement and retrieving all the records.
pStatement | Pointer to the query statement object to create the result set from |
Definition at line 732 of file SQLiteDB.cpp.
References SQLite::DB::GetLastError(), m_arRecords, m_bValid, SQLite::RealStatement::m_db, m_mColumns, SQLite::RealStatement::m_pStatement, SQLite::RealStatement::m_sLastError, MakeTString(), and SQLite::RealStatement::Reset().
SQLite::Realset::~Realset | ( | ) | [inline, protected] |
Destructor
Definition at line 82 of file SQLiteDB.cpp.
int SQLite::Realset::GetColumn | ( | const std::tstring & | sName | ) | const [inline] |
sName | Name of field to to get ordinal of |
Definition at line 104 of file SQLiteDB.cpp.
References m_mColumns.
Referenced by SQLite::RealRecord::GetField().
int SQLite::Realset::GetColumnCount | ( | ) | const [inline] |
Retrieves the number of fields in the record set.
Definition at line 125 of file SQLiteDB.cpp.
References m_mColumns.
Referenced by SQLite::Recordset::GetColumnCount().
std::tstring SQLite::Realset::GetColumnName | ( | int | nNum | ) | const [inline] |
Retrieves the name of the field with the specified ordinal.
nNum | The ordinal number of the field |
Definition at line 131 of file SQLiteDB.cpp.
References m_mColumns.
Referenced by SQLite::Recordset::GetColumnName().
RealRecord* SQLite::Realset::GetRecord | ( | int | nNum | ) | const [inline] |
Retrieves a record by index.
nNum | The index of the record |
Definition at line 110 of file SQLiteDB.cpp.
References m_arRecords.
Referenced by SQLite::Recordset::GetRecord().
int SQLite::Realset::GetRecordCount | ( | ) | const [inline] |
Retrieves the number of records in the set.
Definition at line 115 of file SQLiteDB.cpp.
References m_arRecords.
Referenced by SQLite::Recordset::GetRecordCount().
bool SQLite::Realset::IsValid | ( | ) | const [inline] |
Tests if this records set is valid.
Definition at line 120 of file SQLiteDB.cpp.
References m_bValid.
Referenced by SQLite::Recordset::IsValid(), and Realset().