wxSQLite3Table Class Reference

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

`#include <wxsqlite3.h>`

## Public Member Functions

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

## Detailed Description

Holds the complete result set of a SQL query.

## Constructor & Destructor Documentation

wxSQLite3Table::wxSQLite3Table | ( |  | ) |

Constructor.

wxSQLite3Table::wxSQLite3Table | ( | const wxSQLite3Table & | table | ) |

wxSQLite3Table::wxSQLite3Table | ( | char ** | results,
|  | int | rows,
|  | int | cols
| ) |  |

wxSQLite3Table::~wxSQLite3Table | ( |  | ) |

virtual

## Member Function Documentation

void wxSQLite3Table::Finalize | ( |  | ) |

Finalize the result set.

int wxSQLite3Table::FindColumnIndex | ( | const wxString & | columnName | ) |

Find the index of a column by name.

Parameters

  columnName | name of the column

Returns
  the index of the column

wxString wxSQLite3Table::GetAsString | ( | int | columnIndex | ) |

Get a column as a string using the column index.

Parameters

  columnIndex | index 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 wxSQLite3Table::GetDouble to apply correct conversion from `string` to `double`.

wxString wxSQLite3Table::GetAsString | ( | const wxString & | columnName | ) |

Get a column as a string using the column name.

Parameters

  columnName | name 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 wxSQLite3Table::GetDouble to apply correct conversion from `string` to `double`.

bool wxSQLite3Table::GetBool | ( | int | columnIndex | ) |

Get a column as a boolean using the column index.

Parameters

  columnIndex | index of the column. Indices start with 0.

Returns
  value of the column

bool wxSQLite3Table::GetBool | ( | const wxString & | columnName | ) |

Get a column as a boolean using the column name.

Parameters

  columnName | name of the column

Returns
  value of the column

int wxSQLite3Table::GetColumnCount | ( |  | ) |

Get the number of columns in the result set.

Returns
  the number of columns

wxString wxSQLite3Table::GetColumnName | ( | int | columnIndex | ) |

Get the name of a column.

Parameters

  columnIndex | index of the column. Indices start with 0.

Returns
  name of the column

wxDateTime wxSQLite3Table::GetDate | ( | int | columnIndex | ) |

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

Parameters

  columnIndex | index of the column. Indices start with 0.

Returns
  value of the column

wxDateTime wxSQLite3Table::GetDate | ( | const wxString & | columnName | ) |

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

Parameters

  columnName | name of the column

Returns
  value of the column

wxDateTime wxSQLite3Table::GetDateTime | ( | int | columnIndex | ) |

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

Parameters

  columnIndex | index of the column. Indices start with 0.

Returns
  value of the column

wxDateTime wxSQLite3Table::GetDateTime | ( | const wxString & | columnName | ) |

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

Parameters

  columnName | name of the column

Returns
  value of the column

double wxSQLite3Table::GetDouble | ( | int | columnIndex,
|  | double | nullValue = `0.0`
| ) |  |

Get a column as a double using the column index.

Parameters

  columnIndex | index of the column. Indices start with 0.
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

double wxSQLite3Table::GetDouble | ( | const wxString & | columnName,
|  | double | nullValue = `0.0`
| ) |  |

Get a column as a double using the column name.

Parameters

  columnName | name of the column
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

int wxSQLite3Table::GetInt | ( | int | columnIndex,
|  | int | nullValue = `0`
| ) |  |

Get a column as an integer using the column index.

Parameters

  columnIndex | index of the column. Indices start with 0.
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

int wxSQLite3Table::GetInt | ( | const wxString & | columnName,
|  | int | nullValue = `0`
| ) |  |

Get a column as an integer using the column name.

Parameters

  columnName | name of the column
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

wxLongLong wxSQLite3Table::GetInt64 | ( | int | columnIndex,
|  | wxLongLong | nullValue = `0`
| ) |  |

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

Parameters

  columnIndex | index of the column. Indices start with 0.
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

wxLongLong wxSQLite3Table::GetInt64 | ( | const wxString & | columnName,
|  | wxLongLong | nullValue = `0`
| ) |  |

Get a column as an integer using the column name.

Parameters

  columnName | name of the column
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

int wxSQLite3Table::GetRowCount | ( |  | ) |

Get the number of rows in the result set.

Returns
  the number of rows

wxString wxSQLite3Table::GetString | ( | int | columnIndex,
|  | const wxString & | nullValue = `wxEmptyString`
| ) |  |

Get a column as a string using the column index.

Parameters

  columnIndex | index of the column. Indices start with 0.
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

wxString wxSQLite3Table::GetString | ( | const wxString & | columnName,
|  | const wxString & | nullValue = `wxEmptyString`
| ) |  |

Get a column as a string using the column name.

Parameters

  columnName | name of the column
  nullValue | value to be returned in case the column is NULL

Returns
  value of the column

wxDateTime wxSQLite3Table::GetTime | ( | int | columnIndex | ) |

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

Parameters

  columnIndex | index of the column. Indices start with 0.

Returns
  value of the column

wxDateTime wxSQLite3Table::GetTime | ( | const wxString & | columnName | ) |

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

Parameters

  columnName | name of the column

Returns
  value of the column

bool wxSQLite3Table::IsNull | ( | int | columnIndex | ) |

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

Parameters

  columnIndex | index of the column. Indices start with 0.

Returns
  TRUE if the value is NULL, FALSE otherwise

bool wxSQLite3Table::IsNull | ( | const wxString & | columnName | ) |

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

Parameters

  columnName | name of the column

Returns
  TRUE if the value is NULL, FALSE otherwise

bool wxSQLite3Table::IsOk | ( |  | ) |

Validate associated SQLite resultset.

Returns
  TRUE if SQLite resultset is associated, FALSE otherwise

wxSQLite3Table & wxSQLite3Table::operator= | ( | const wxSQLite3Table & | table | ) |

void wxSQLite3Table::SetRow | ( | int | row | ) |

Set the current row.

Parameters

  row | index of the requested row. Indices start with 0.

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

- wxsqlite3.h
- wxsqlite3.cpp