| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes
TeSQLitePortal Class Reference

`#include <TeSQLite.h>`

Inheritance diagram for TeSQLitePortal:

List of all members.

## 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.

Parameters:

  geom | the geometry that will be filled from portal
  initIndex | the position index in the portal where begins the geometry information

Returns:
  The fetchGeometry methods advance the portal to the next record and they return TRUE if there are more records to be read and FALSE otherwise.

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

## Constructor & Destructor Documentation

TeSQLitePortal::TeSQLitePortal | ( |  | ) |

Constructor.

TeSQLitePortal::TeSQLitePortal | ( | TeDatabase * | pDatabase | ) |

Constructor.

TeSQLitePortal::~TeSQLitePortal | ( |  | ) | `[virtual]`

Virtual Destructor.

## Member Function Documentation

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.

TeTime TeSQLitePortal::getDate | ( | const string & | s | ) | `[virtual]`

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.

string TeSQLitePortal::getDateAsString | ( | const string & | s | ) | `[virtual]`

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.

## Member Data Documentation

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]`

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/SQLite/TeSQLite.h
- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/drivers/SQLite/TeSQLite.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines