27 #include "../common/Translator.h"
28 #include "../geometry/Geometry.h"
55 : m_stmt(stmt), m_parent(t), m_dt(0)
65 ret = sqlite3_finalize(m_stmt);
67 assert(ret == SQLITE_OK);
95 return m_pImpl->m_dt->size();
100 return m_pImpl->m_dt->getProperty(i)->getType();
105 return m_pImpl->m_dt->getProperty(i)->getName();
135 return (sqlite3_step(m_pImpl->m_stmt) == SQLITE_ROW);
150 int ret = sqlite3_reset(m_pImpl->m_stmt);
155 return (sqlite3_step(m_pImpl->m_stmt) == SQLITE_ROW);
190 int value = sqlite3_column_int(m_pImpl->m_stmt, i);
192 return static_cast<char>(value);
197 int value = sqlite3_column_int(m_pImpl->m_stmt, i);
199 return static_cast<unsigned char>(value);
204 return static_cast<boost::int16_t
>(sqlite3_column_int(m_pImpl->m_stmt, i));
209 return sqlite3_column_int(m_pImpl->m_stmt, i);
214 return sqlite3_column_int64(m_pImpl->m_stmt, i);
224 return static_cast<float>(sqlite3_column_double(m_pImpl->m_stmt, i));
229 return sqlite3_column_double(m_pImpl->m_stmt, i);
234 std::string value((
const char*)(sqlite3_column_text(m_pImpl->m_stmt, i)));
241 return (
const char*)(sqlite3_column_text(m_pImpl->m_stmt, i));
251 unsigned char* ewkb = (
unsigned char*)(sqlite3_column_blob(m_pImpl->m_stmt, i));
252 std::auto_ptr<te::gm::Geometry> g(EWKBReader::read(ewkb));
273 return sqlite3_column_type(m_pImpl->m_stmt, i) == SQLITE_NULL;
te::common::AccessPolicy getAccessPolicy() const
It returns the read and write permission associated to the dataset.
Configuration flags for the SQLite Data Access driver.
boost::int64_t getInt64(std::size_t i) const
Method for retrieving a 64-bit integer attribute value (8 bytes long).
std::string getPropertyName(std::size_t i) const
It returns the property name at position pos.
bool moveBeforeFirst()
It moves the internal pointer to a position before the first item in the collection.
char getChar(std::size_t i) const
Method for retrieving a signed character attribute value (1 byte long).
bool moveNext()
It moves the internal pointer to the next item of the collection.
A class that models the description of a dataset.
bool isAfterEnd() const
It tells if the dataset internal pointer is on the sentinel position after the last element of the co...
bool getBool(std::size_t i) const
Method for retrieving a boolean attribute value.
Impl(sqlite3_stmt *stmt, DataSourceTransactor *t)
std::string getDatasetNameOfProperty(std::size_t i) const
It returns the underlying dataset name of the property at position pos.
bool isAtBegin() const
It tells if the dataset internal pointer is on the first element of the collection or not...
std::auto_ptr< te::dt::DateTime > getDateTime(std::size_t i) const
Method for retrieving a date and time attribute value.
double getDouble(std::size_t i) const
Method for retrieving a double attribute value.
FwDataSet(sqlite3_stmt *stmt, DataSourceTransactor *t)
float getFloat(std::size_t i) const
Method for retrieving a float attribute value.
std::size_t size() const
It returns the collection size, if it is known.
bool isBeforeBegin() const
It tells if the dataset internal pointer is in a position before the first element of the collection ...
boost::int16_t getInt16(std::size_t i) const
Method for retrieving a 16-bit integer attribute value (2 bytes long).
DataSourceTransactor * m_parent
std::auto_ptr< te::dt::ByteArray > getByteArray(std::size_t i) const
Method for retrieving a byte array.
AccessPolicy
Supported data access policies (can be used as bitfield).
TraverseType
A dataset can be traversed in two ways:
std::string getString(std::size_t i) const
Method for retrieving a string value attribute.
int getPropertyDataType(std::size_t i) const
It returns the underlying data type of the property at position pos.
te::da::DataSetType * m_dt
bool moveLast()
It sets the dataset internal pointer to the last item in the collection.
unsigned char getUChar(std::size_t i) const
Method for retrieving an unsigned character attribute value (1 byte long).
bool isConnected() const
It returns true if the dataset is connected and false if it is disconnected. A dataset can be connect...
bool isEmpty() const
It returns true if the collection is empty.
std::auto_ptr< te::dt::Array > getArray(std::size_t i) const
Method for retrieving an array.
std::auto_ptr< te::gm::Envelope > getExtent(std::size_t i)
It computes the bounding rectangle for a spatial property of the dataset.
Utility functions for the TerraLib SQLite Data Access driver.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
std::size_t getNumProperties() const
It returns the number of properties that composes an item of the dataset.
te::common::TraverseType getTraverseType() const
It returns the traverse type associated to the dataset.
bool movePrevious()
It moves the internal pointer to the previous item of the collection.
bool isAtEnd() const
It tells if the dataset internal pointer is on the last element of the collection.
bool move(std::size_t i)
It moves the dataset internal pointer to a given position.
std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const
Method for retrieving a geometric attribute value.
struct sqlite3_stmt sqlite3_stmt
An implementation of DataSourceTransactor class for the TerraLib SQLite Data Access Driver...
bool isNull(std::size_t i) const
It checks if the attribute value is NULL.
bool moveFirst()
It moves the internal pointer to the first item in the collection.
std::string getNumeric(std::size_t i) const
Method for retrieving a numeric attribute value.
boost::int32_t getInt32(std::size_t i) const
Method for retrieving a 32-bit integer attribute value (4 bytes long).
te::da::DataSetType * Convert2TerraLib(sqlite3_stmt *pStmt)
std::auto_ptr< te::rst::Raster > getRaster(std::size_t i) const
Method for retrieving a raster attribute value.
#define TE_SQLITE_BOOL_TRUE
A flag that indicates a false value (boolean).
Implementation of a forward-only dataset for the TerraLib SQLite Data Access driver.
An utility class for reading a SpatiaLite EWKB geometry.