wxSQLite3  5.0.1
Loading...
Searching...
No Matches
wxSQLite3::Table Class Reference

Holds the complete result set of a SQL query. More...

#include <wxsqlite3.h>

Public Member Functions

 Table ()
 Constructor.
 Table (const Table &table)
 Table (char **results, int rows, int cols)
virtual ~Table ()
Tableoperator= (const Table &table)
int GetColumnCount () const
 Get the number of columns in the result set.
int GetRowCount () const
 Get the number of rows in the result set.
int FindColumnIndex (const wxString &columnName) const
 Find the index of a column by name.
wxString GetColumnName (int columnIndex) const
 Get the name of a column.
wxString GetAsString (int columnIndex) const
 Get a column as a string using the column index.
wxString GetAsString (const wxString &columnName) const
 Get a column as a string using the column name.
int GetInt (int columnIndex, int nullValue=0) const
 Get a column as an integer using the column index.
int GetInt (const wxString &columnName, int nullValue=0) const
 Get a column as an integer using the column name.
wxLongLong GetInt64 (int columnIndex, wxLongLong nullValue=0) const
 Get a column as a 64-bit integer using the column index.
wxLongLong GetInt64 (const wxString &columnName, wxLongLong nullValue=0) const
 Get a column as an integer using the column name.
double GetDouble (int columnIndex, double nullValue=0.0) const
 Get a column as a double using the column index.
double GetDouble (const wxString &columnName, double nullValue=0.0) const
 Get a column as a double using the column name.
wxString GetString (int columnIndex, const wxString &nullValue=wxEmptyString) const
 Get a column as a string using the column index.
wxString GetString (const wxString &columnName, const wxString &nullValue=wxEmptyString) const
 Get a column as a string using the column name.
wxDateTime GetDate (int columnIndex) const
 Get a column as a date value using the column index.
wxDateTime GetDate (const wxString &columnName) const
 Get a column as a date value using the column name.
wxDateTime GetTime (int columnIndex) const
 Get a column as a time value using the column index.
wxDateTime GetTime (const wxString &columnName) const
 Get a column as a time value using the column name.
wxDateTime GetDateTime (int columnIndex) const
 Get a column as a date/time value using the column index.
wxDateTime GetDateTime (const wxString &columnName) const
 Get a column as a date/time value using the column name.
bool GetBool (int columnIndex) const
 Get a column as a boolean using the column index.
bool GetBool (const wxString &columnName) const
 Get a column as a boolean using the column name.
bool IsNull (int columnIndex) const
 Check whether the column selected by index is a NULL value.
bool IsNull (const wxString &columnName) const
 Check whether the column selected by name is a NULL value.
void SetRow (int row)
 Set the current row.
void Finalize ()
 Finalize the result set.
bool IsOk () const
 Validate associated SQLite resultset.

Detailed Description

Holds the complete result set of a SQL query.

Constructor & Destructor Documentation

◆ Table() [1/3]

wxSQLite3::Table::Table ( )

Constructor.

◆ Table() [2/3]

wxSQLite3::Table::Table ( const Table & table)

◆ Table() [3/3]

wxSQLite3::Table::Table ( char ** results,
int rows,
int cols )

◆ ~Table()

virtual wxSQLite3::Table::~Table ( )
virtual

Member Function Documentation

◆ Finalize()

void wxSQLite3::Table::Finalize ( )

Finalize the result set.

◆ FindColumnIndex()

int wxSQLite3::Table::FindColumnIndex ( const wxString & columnName) const

Find the index of a column by name.

Parameters
columnNamename of the column
Returns
the index of the column

◆ GetAsString() [1/2]

wxString wxSQLite3::Table::GetAsString ( const wxString & columnName) const

Get a column as a string using the column name.

Parameters
columnNamename of the column
Returns
value of the column as a string
Note
This method returns values of type double always using the point character as the decimal separator. This is SQLite default behaviour. Use method Table::GetDouble to apply correct conversion from string to double.

◆ GetAsString() [2/2]

wxString wxSQLite3::Table::GetAsString ( int columnIndex) const

Get a column as a string using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
Returns
value of the column as a string
Note
This method returns values of type double always using the point character as the decimal separator. This is SQLite default behaviour. Use method Table::GetDouble to apply correct conversion from string to double.

◆ GetBool() [1/2]

bool wxSQLite3::Table::GetBool ( const wxString & columnName) const

Get a column as a boolean using the column name.

Parameters
columnNamename of the column
Returns
value of the column

◆ GetBool() [2/2]

bool wxSQLite3::Table::GetBool ( int columnIndex) const

Get a column as a boolean using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
Returns
value of the column

◆ GetColumnCount()

int wxSQLite3::Table::GetColumnCount ( ) const

Get the number of columns in the result set.

Returns
the number of columns

◆ GetColumnName()

wxString wxSQLite3::Table::GetColumnName ( int columnIndex) const

Get the name of a column.

Parameters
columnIndexindex of the column. Indices start with 0.
Returns
name of the column

◆ GetDate() [1/2]

wxDateTime wxSQLite3::Table::GetDate ( const wxString & columnName) const

Get a column as a date value using the column name.

Parameters
columnNamename of the column
Returns
value of the column

◆ GetDate() [2/2]

wxDateTime wxSQLite3::Table::GetDate ( int columnIndex) const

Get a column as a date value using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
Returns
value of the column

◆ GetDateTime() [1/2]

wxDateTime wxSQLite3::Table::GetDateTime ( const wxString & columnName) const

Get a column as a date/time value using the column name.

Parameters
columnNamename of the column
Returns
value of the column

◆ GetDateTime() [2/2]

wxDateTime wxSQLite3::Table::GetDateTime ( int columnIndex) const

Get a column as a date/time value using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
Returns
value of the column

◆ GetDouble() [1/2]

double wxSQLite3::Table::GetDouble ( const wxString & columnName,
double nullValue = 0.0 ) const

Get a column as a double using the column name.

Parameters
columnNamename of the column
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetDouble() [2/2]

double wxSQLite3::Table::GetDouble ( int columnIndex,
double nullValue = 0.0 ) const

Get a column as a double using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetInt() [1/2]

int wxSQLite3::Table::GetInt ( const wxString & columnName,
int nullValue = 0 ) const

Get a column as an integer using the column name.

Parameters
columnNamename of the column
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetInt() [2/2]

int wxSQLite3::Table::GetInt ( int columnIndex,
int nullValue = 0 ) const

Get a column as an integer using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetInt64() [1/2]

wxLongLong wxSQLite3::Table::GetInt64 ( const wxString & columnName,
wxLongLong nullValue = 0 ) const

Get a column as an integer using the column name.

Parameters
columnNamename of the column
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetInt64() [2/2]

wxLongLong wxSQLite3::Table::GetInt64 ( int columnIndex,
wxLongLong nullValue = 0 ) const

Get a column as a 64-bit integer using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetRowCount()

int wxSQLite3::Table::GetRowCount ( ) const

Get the number of rows in the result set.

Returns
the number of rows

◆ GetString() [1/2]

wxString wxSQLite3::Table::GetString ( const wxString & columnName,
const wxString & nullValue = wxEmptyString ) const

Get a column as a string using the column name.

Parameters
columnNamename of the column
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetString() [2/2]

wxString wxSQLite3::Table::GetString ( int columnIndex,
const wxString & nullValue = wxEmptyString ) const

Get a column as a string using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
nullValuevalue to be returned in case the column is NULL
Returns
value of the column

◆ GetTime() [1/2]

wxDateTime wxSQLite3::Table::GetTime ( const wxString & columnName) const

Get a column as a time value using the column name.

Parameters
columnNamename of the column
Returns
value of the column

◆ GetTime() [2/2]

wxDateTime wxSQLite3::Table::GetTime ( int columnIndex) const

Get a column as a time value using the column index.

Parameters
columnIndexindex of the column. Indices start with 0.
Returns
value of the column

◆ IsNull() [1/2]

bool wxSQLite3::Table::IsNull ( const wxString & columnName) const

Check whether the column selected by name is a NULL value.

Parameters
columnNamename of the column
Returns
TRUE if the value is NULL, FALSE otherwise

◆ IsNull() [2/2]

bool wxSQLite3::Table::IsNull ( int columnIndex) const

Check whether the column selected by index is a NULL value.

Parameters
columnIndexindex of the column. Indices start with 0.
Returns
TRUE if the value is NULL, FALSE otherwise

◆ IsOk()

bool wxSQLite3::Table::IsOk ( ) const

Validate associated SQLite resultset.

Returns
TRUE if SQLite resultset is associated, FALSE otherwise

◆ operator=()

Table & wxSQLite3::Table::operator= ( const Table & table)

◆ SetRow()

void wxSQLite3::Table::SetRow ( int row)

Set the current row.

Parameters
rowindex of the requested row. Indices start with 0.

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