27 #include "../../common/HexUtils.h"
28 #include "../../common/StringUtils.h"
29 #include "../../datatype/AbstractData.h"
30 #include "../../datatype/Array.h"
31 #include "../../datatype/ByteArray.h"
32 #include "../../datatype/DateTime.h"
33 #include "../../datatype/Property.h"
34 #include "../../datatype/SimpleData.h"
35 #include "../../raster/Raster.h"
36 #include "../utils/Utils.h"
44 #include <boost/lexical_cast.hpp>
106 return getNumeric(i);
120 return getByteArray(i);
127 return getGeometry(i);
141 return getDateTime(i);
153 switch(getPropertyDataType(i))
156 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Char(getChar(i)));
159 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UChar(getUChar(i)));
162 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int16(getInt16(i)));
165 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt16(getInt16(i)));
168 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int32(getInt32(i)));
171 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt32(getInt32(i)));
174 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Int64(getInt64(i)));
177 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::UInt64(getInt64(i)));
180 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Boolean(getBool(i)));
183 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Float(getFloat(i)));
189 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::Numeric(getNumeric(i)));
192 return std::auto_ptr<te::dt::AbstractData>(
new te::dt::String(getString(i)));
195 return std::auto_ptr<te::dt::AbstractData>(getByteArray(i));
198 return std::auto_ptr<te::dt::AbstractData>(getGeometry(i));
201 return std::auto_ptr<te::dt::AbstractData>(getDateTime(i));
204 return std::auto_ptr<te::dt::AbstractData>(getRaster(i));
207 return std::auto_ptr<te::dt::AbstractData>(0);
222 switch(getPropertyDataType(i))
233 value = boost::lexical_cast<std::string>(getInt16(i));
237 value = boost::lexical_cast<std::string>(getInt32(i));
241 value = boost::lexical_cast<std::string>(getInt64(i));
245 value = boost::lexical_cast<std::string>(getBool(i));
249 value = boost::lexical_cast<std::string>(getFloat(i));
257 value = getNumeric(i);
261 value = getString(i);
266 std::auto_ptr<te::dt::AbstractData> b(getByteArray(i));
267 value = b->toString();
273 std::auto_ptr<te::dt::AbstractData> g(getGeometry(i));
274 value = g->toString();
280 std::auto_ptr<te::dt::AbstractData> dTime(getDateTime(i));
281 value = dTime->toString();
287 std::auto_ptr<te::dt::Array> a(getArray(i));
288 value = a->toString();
294 std::auto_ptr<te::dt::AbstractData> r(getRaster(i));
295 value = r->toString();
310 return getAsString(i, precision);
virtual std::auto_ptr< te::dt::DateTime > getDateTime(std::size_t i) const =0
Method for retrieving a date and time attribute value.
SimpleData< std::string, STRING_TYPE > String
virtual boost::int16_t getInt16(std::size_t i) const =0
Method for retrieving a 16-bit integer attribute value (2 bytes long).
virtual boost::int32_t getInt32(std::size_t i) const =0
Method for retrieving a 32-bit integer attribute value (4 bytes long).
SimpleData< unsigned char, UCHAR_TYPE > UChar
virtual char getChar(std::size_t i) const =0
Method for retrieving a signed character attribute value (1 byte long).
virtual bool getBool(std::size_t i) const =0
Method for retrieving a boolean attribute value.
virtual boost::int64_t getInt64(std::size_t i) const =0
Method for retrieving a 64-bit integer attribute value (8 bytes long).
SimpleData< boost::int64_t, INT64_TYPE > Int64
SimpleData< boost::int32_t, INT32_TYPE > Int32
TEDATAACCESSEXPORT std::size_t GetPropertyPos(const DataSet *dataset, const std::string &name)
virtual std::auto_ptr< te::dt::ByteArray > getByteArray(std::size_t i) const =0
Method for retrieving a byte array.
virtual std::auto_ptr< te::rst::Raster > getRaster(std::size_t i) const =0
Method for retrieving a raster attribute value.
SimpleData< float, FLOAT_TYPE > Float
virtual std::string getNumeric(std::size_t i) const =0
Method for retrieving a numeric attribute value.
virtual double getDouble(std::size_t i) const =0
Method for retrieving a double attribute value.
SimpleData< std::string, NUMERIC_TYPE > Numeric
virtual float getFloat(std::size_t i) const =0
Method for retrieving a float attribute value.
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
SimpleData< boost::uint64_t, UINT64_TYPE > UInt64
virtual std::string getAsString(std::size_t i, int precision=0) const
Method for retrieving a data value as a string plain representation.
virtual std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
SimpleData< bool, BOOLEAN_TYPE > Boolean
virtual std::auto_ptr< te::dt::Array > getArray(std::size_t i) const =0
Method for retrieving an array.
A class that models the description of a dataset.
SimpleData< double, DOUBLE_TYPE > Double
SimpleData< char, CHAR_TYPE > Char
SimpleData< boost::uint16_t, UINT16_TYPE > UInt16
virtual std::string getString(std::size_t i) const =0
Method for retrieving a string value attribute.
std::string Convert2String(boost::int16_t value)
It converts a short integer value to a string.
A dataset is the unit of information manipulated by the data access module of TerraLib.
virtual unsigned char getUChar(std::size_t i) const =0
Method for retrieving an unsigned character attribute value (1 byte long).
SimpleData< boost::int16_t, INT16_TYPE > Int16
SimpleData< boost::uint32_t, UINT32_TYPE > UInt32
virtual std::auto_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.