![]() |
TerraLib 4.1
|
#include <TeSQLite.h>
Public Member Functions | |||||
| TeSQLitePortal () | |||||
| Constructor. | |||||
| TeSQLitePortal (TeDatabase *pDatabase) | |||||
| Constructor. | |||||
| virtual | ~TeSQLitePortal () | ||||
| Virtual Destructor. | |||||
| virtual bool | query (const string &qry, TeCursorLocation l=TeSERVERSIDE, TeCursorType t=TeUNIDIRECTIONAL, TeCursorEditType e=TeREADONLY, TeCursorDataType dt=TeTEXTCURSOR) | ||||
| Executes a SQL query that opens a record set. | |||||
| virtual bool | fetchRow () | ||||
| Fetchs the next row in a record set that shouldve been previously opened. | |||||
| virtual bool | fetchRow (int i) | ||||
| Fetchs a particular row. | |||||
| virtual void | freeResult () | ||||
| Frees the current record set. | |||||
| virtual char * | getData (int i) | ||||
| Gets the value of the i-th attribute as a literal. | |||||
| virtual char * | getData (const string &s) | ||||
| Gets the value of a named attribute as a literal. | |||||
| virtual int | getInt (int i) | ||||
| Gets the value of the i-th attribute as an integer. | |||||
| virtual int | getInt (const string &s) | ||||
| Gets the value of a named attribute as an integer. | |||||
| virtual bool | getBool (const string &s) | ||||
| Gets the value of a named attribute as a boolean. | |||||
| virtual bool | getBool (int i) | ||||
| Gets the value of the i-th attribute as a boolean. | |||||
| virtual TeTime | getDate (int i) | ||||
| Gets the value of the i-th attribute as a date. | |||||
| virtual TeTime | getDate (const string &s) | ||||
| Gets the value of a named attribute as a date. | |||||
| virtual string | getDateAsString (int i) | ||||
| Gets the of a date/time attribute as a string formatted as accepted in further SQL statements. | |||||
| virtual string | getDateAsString (const string &s) | ||||
| Gets the of a date/time attribute as a string formatted as accepted in further SQL statements. | |||||
| virtual bool | getBlob (const string &s, unsigned char *&data, long &size) | ||||
| Gets the value of a named BLOB attribute. | |||||
| virtual bool | getRasterBlock (unsigned long &size, unsigned char *ptData) | ||||
| int | getColumnIndex (const string &s) | ||||
| Gets the index of a named attribute. | |||||
| virtual string | errorMessage () | ||||
| Gets the last error message. | |||||
Fetch Geometry | |||||
The following methods decodify geometries as stored in the database according to the data model proposed in TerraLib.
| |||||
| virtual bool | fetchGeometry (TePolygon &geom) | ||||
| virtual bool | fetchGeometry (TePolygon &geom, const unsigned int &initIndex) | ||||
| virtual bool | fetchGeometry (TeLine2D &geom) | ||||
| virtual bool | fetchGeometry (TeLine2D &geom, const unsigned int &initIndex) | ||||
| virtual bool | fetchGeometry (TeNode &geom) | ||||
| virtual bool | fetchGeometry (TeNode &geom, const unsigned int &initIndex) | ||||
| virtual bool | fetchGeometry (TePoint &geom) | ||||
| virtual bool | fetchGeometry (TePoint &geom, const unsigned int &initIndex) | ||||
Protected Attributes | |||||
| sqlite3 * | _conn | ||||
| sqlite3_stmt * | _recordSet | ||||
| bool | _skipFirstFetch | ||||
| bool | _firstFetchResult | ||||
| int | _currentRow | ||||
| std::string | _query | ||||
| std::map< std::string, int > | _mapColumnNames | ||||
| TeSQLitePortal::TeSQLitePortal | ( | ) |
Constructor.
| TeSQLitePortal::TeSQLitePortal | ( | TeDatabase * | pDatabase | ) |
Constructor.
| TeSQLitePortal::~TeSQLitePortal | ( | ) | [virtual] |
Virtual Destructor.
| string TeSQLitePortal::errorMessage | ( | ) | [virtual] |
Gets the last error message.
Reimplemented from TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TePolygon & | geom, |
| const unsigned int & | initIndex | ||
| ) | [virtual] |
Reimplemented from TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TeLine2D & | geom | ) | [virtual] |
Implements TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TeLine2D & | geom, |
| const unsigned int & | initIndex | ||
| ) | [virtual] |
Reimplemented from TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TeNode & | geom | ) | [virtual] |
Implements TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TeNode & | geom, |
| const unsigned int & | initIndex | ||
| ) | [virtual] |
Reimplemented from TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TePolygon & | geom | ) | [virtual] |
Implements TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TePoint & | geom | ) | [virtual] |
Implements TeDatabasePortal.
| bool TeSQLitePortal::fetchGeometry | ( | TePoint & | geom, |
| const unsigned int & | initIndex | ||
| ) | [virtual] |
Reimplemented from TeDatabasePortal.
| bool TeSQLitePortal::fetchRow | ( | ) | [virtual] |
Fetchs the next row in a record set that shouldve been previously opened.
Implements TeDatabasePortal.
| bool TeSQLitePortal::fetchRow | ( | int | i | ) | [virtual] |
Fetchs a particular row.
Implements TeDatabasePortal.
| void TeSQLitePortal::freeResult | ( | void | ) | [virtual] |
Frees the current record set.
Implements TeDatabasePortal.
| bool TeSQLitePortal::getBlob | ( | const string & | s, |
| unsigned char *& | data, | ||
| long & | size | ||
| ) | [virtual] |
Gets the value of a named BLOB attribute.
Implements TeDatabasePortal.
| bool TeSQLitePortal::getBool | ( | const string & | s | ) | [virtual] |
Gets the value of a named attribute as a boolean.
Implements TeDatabasePortal.
| bool TeSQLitePortal::getBool | ( | int | i | ) | [virtual] |
Gets the value of the i-th attribute as a boolean.
Implements TeDatabasePortal.
| int TeSQLitePortal::getColumnIndex | ( | const string & | s | ) |
Gets the index of a named attribute.
Reimplemented from TeDatabasePortal.
| char * TeSQLitePortal::getData | ( | int | i | ) | [virtual] |
Gets the value of the i-th attribute as a literal.
Implements TeDatabasePortal.
| char * TeSQLitePortal::getData | ( | const string & | s | ) | [virtual] |
Gets the value of a named attribute as a literal.
Implements TeDatabasePortal.
| TeTime TeSQLitePortal::getDate | ( | int | i | ) | [virtual] |
Gets the value of the i-th attribute as a date.
Implements TeDatabasePortal.
Gets the value of a named attribute as a date.
Implements TeDatabasePortal.
| string TeSQLitePortal::getDateAsString | ( | int | i | ) | [virtual] |
Gets the of a date/time attribute as a string formatted as accepted in further SQL statements.
Implements TeDatabasePortal.
Gets the of a date/time attribute as a string formatted as accepted in further SQL statements.
Implements TeDatabasePortal.
| int TeSQLitePortal::getInt | ( | int | i | ) | [virtual] |
Gets the value of the i-th attribute as an integer.
Reimplemented from TeDatabasePortal.
| int TeSQLitePortal::getInt | ( | const string & | s | ) | [virtual] |
Gets the value of a named attribute as an integer.
Reimplemented from TeDatabasePortal.
| bool TeSQLitePortal::getRasterBlock | ( | unsigned long & | size, |
| unsigned char * | ptData | ||
| ) | [virtual] |
Implements TeDatabasePortal.
| bool TeSQLitePortal::query | ( | const string & | qry, |
| TeCursorLocation | l = TeSERVERSIDE, |
||
| TeCursorType | t = TeUNIDIRECTIONAL, |
||
| TeCursorEditType | e = TeREADONLY, |
||
| TeCursorDataType | dt = TeTEXTCURSOR |
||
| ) | [virtual] |
Executes a SQL query that opens a record set.
Implements TeDatabasePortal.
sqlite3* TeSQLitePortal::_conn [protected] |
int TeSQLitePortal::_currentRow [protected] |
bool TeSQLitePortal::_firstFetchResult [protected] |
std::map<std::string, int> TeSQLitePortal::_mapColumnNames [protected] |
std::string TeSQLitePortal::_query [protected] |
sqlite3_stmt* TeSQLitePortal::_recordSet [protected] |
bool TeSQLitePortal::_skipFirstFetch [protected] |