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;
bool movePrevious()
It moves the internal pointer to the previous item of the collection.
An utility class for reading a SpatiaLite EWKB geometry.
te::da::DataSetType * m_dt
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
bool isBeforeBegin() const
It tells if the dataset internal pointer is in a position before the first element of the collection ...
double getDouble(std::size_t i) const
Method for retrieving a double attribute value.
An implementation of DataSourceTransactor class for the TerraLib SQLite Data Access Driver...
boost::int32_t getInt32(std::size_t i) const
Method for retrieving a 32-bit integer attribute value (4 bytes long).
bool moveBeforeFirst()
It moves the internal pointer to a position before the first item in the collection.
te::common::AccessPolicy getAccessPolicy() const
It returns the read and write permission associated to the dataset.
std::auto_ptr< te::dt::ByteArray > getByteArray(std::size_t i) const
Method for retrieving a byte array.
std::string getString(std::size_t i) const
Method for retrieving a string value attribute.
unsigned char getUChar(std::size_t i) const
Method for retrieving an unsigned character attribute value (1 byte long).
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.
std::string getPropertyName(std::size_t i) const
It returns the property name at position pos.
bool moveFirst()
It moves the internal pointer to the first item in the collection.
bool isAfterEnd() const
It tells if the dataset internal pointer is on the sentinel position after the last element of the co...
AccessPolicy
Supported data access policies (can be used as bitfield).
DataSourceTransactor * m_parent
std::auto_ptr< te::gm::Envelope > getExtent(std::size_t i)
It computes the bounding rectangle for a spatial property of the dataset.
std::auto_ptr< te::dt::Array > getArray(std::size_t i) const
Method for retrieving an array.
Impl(sqlite3_stmt *stmt, DataSourceTransactor *t)
int getPropertyDataType(std::size_t i) const
It returns the underlying data type of the property at position pos.
bool isNull(std::size_t i) const
It checks if the attribute value is NULL.
te::common::TraverseType getTraverseType() const
It returns the traverse type associated to the dataset.
FwDataSet(sqlite3_stmt *stmt, DataSourceTransactor *t)
bool move(std::size_t i)
It moves the dataset internal pointer to a given position.
Utility functions for the TerraLib SQLite Data Access driver.
std::size_t getNumProperties() const
It returns the number of properties that composes an item of the dataset.
std::auto_ptr< te::dt::DateTime > getDateTime(std::size_t i) const
Method for retrieving a date and time attribute value.
float getFloat(std::size_t i) const
Method for retrieving a float attribute value.
boost::int64_t getInt64(std::size_t i) const
Method for retrieving a 64-bit integer attribute value (8 bytes long).
TraverseType
A dataset can be traversed in two ways:
#define TR_COMMON(message)
It marks a string in order to get translated. This is the mark used in the Common module of TerraLib...
bool isEmpty() const
It returns true if the collection is empty.
std::size_t size() const
It returns the collection size, if it is known.
te::da::DataSetType * Convert2TerraLib(sqlite3_stmt *pStmt)
Implementation of a forward-only dataset for the TerraLib SQLite Data Access driver.
A class that models the description of a dataset.
bool moveLast()
It sets the dataset internal pointer to the last item in the collection.
bool isAtBegin() const
It tells if the dataset internal pointer is on the first element of the collection or not...
std::string getDatasetNameOfProperty(std::size_t i) const
It returns the underlying dataset name of the property at position pos.
Configuration flags for the SQLite Data Access driver.
boost::int16_t getInt16(std::size_t i) const
Method for retrieving a 16-bit integer attribute value (2 bytes long).
bool isConnected() const
It returns true if the dataset is connected and false if it is disconnected. A dataset can be connect...
std::string getNumeric(std::size_t i) const
Method for retrieving a numeric attribute value.
std::auto_ptr< te::rst::Raster > getRaster(std::size_t i) const
Method for retrieving a raster attribute value.
bool getBool(std::size_t i) const
Method for retrieving a boolean attribute value.
std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const
Method for retrieving a geometric attribute value.
struct sqlite3_stmt sqlite3_stmt
bool isAtEnd() const
It tells if the dataset internal pointer is on the last element of the collection.
#define TE_SQLITE_BOOL_TRUE
A flag that indicates a false value (boolean).