SQLite::Realset Class Reference

Class handling an SQLite record set (read only!). More...

Inherits SQLite::RefObj.

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

List of all members.

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

Detailed Description

Class handling an SQLite record set (read only!).

Definition at line 66 of file SQLiteDB.cpp.


Constructor & Destructor Documentation

SQLite::Realset::Realset ( sqlite3 *  pDB,
LPCTSTR  pSQL 
) [inline]

Constructor from an SQL statement.

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

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


Member Function Documentation

int SQLite::Realset::GetColumn ( const std::tstring &  sName  )  const [inline]
Parameters:
sName Name of field to to get ordinal of
Returns:
The ordinal number of the field

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.

Returns:
The number of fields

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.

Parameters:
nNum The ordinal number of the field
Returns:
The name of the requested 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.

Parameters:
nNum The index of the record
Returns:
A pointer to the record object, or NULL if no such record exists

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.

Returns:
The number of records

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.

Returns:
true if the record set is valid, false otherwise

Definition at line 120 of file SQLiteDB.cpp.

References m_bValid.

Referenced by SQLite::Recordset::IsValid(), and Realset().


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