27 #include "../common/Translator.h"
34 #include <boost/lexical_cast.hpp>
39 return new Int16(boost::lexical_cast<int16_t>(static_cast<const String*>(d)->getValue()));
45 return new UInt16(boost::lexical_cast<uint16_t>(static_cast<const String*>(d)->getValue()));
51 return new Int32(boost::lexical_cast<int32_t>(static_cast<const String*>(d)->getValue()));
57 return new UInt32(boost::lexical_cast<uint32_t>(static_cast<const String*>(d)->getValue()));
63 return new Int64(boost::lexical_cast<int64_t>(static_cast<const String*>(d)->getValue()));
69 return new UInt64(boost::lexical_cast<uint64_t>(static_cast<const String*>(d)->getValue()));
75 return new Float(boost::lexical_cast<float>(static_cast<const String*>(d)->getValue()));
81 return new Double(boost::lexical_cast<double>(static_cast<const String*>(d)->getValue()));
87 return new Numeric(static_cast<const String*>(d)->getValue());
93 throw Exception(
TE_TR(
"The input data type is not a string!"));
AbstractData * StringToDoubleConverter(AbstractData *d)
It converts an String data value to a double data value.
AbstractData * StringToUInt32Converter(AbstractData *d)
It converts an String data value to an unsigned Int32 data value.
An exception class for the DataType module.
AbstractData * StringToUInt16Converter(AbstractData *d)
It converts an String data value to an unsigned Int16 data value.
SimpleData< boost::int64_t, INT64_TYPE > Int64
SimpleData< boost::int32_t, INT32_TYPE > Int32
SimpleData< float, FLOAT_TYPE > Float
#define TE_TR(message)
It marks a string in order to get translated.
SimpleData< std::string, NUMERIC_TYPE > Numeric
AbstractData * StringToFloatConverter(AbstractData *d)
It converts an String data value to a float data value.
AbstractData * StringToInt16Converter(AbstractData *d)
It converts an String data value to a Int16 data value.
void AssertString(AbstractData *d)
Auxiliary method that asserts that the given data is an String type.
SimpleData< boost::uint64_t, UINT64_TYPE > UInt64
A base class for values that can be retrieved from the data access module.
AbstractData * StringToInt64Converter(AbstractData *d)
It converts an String data value to a Int64 data value.
SimpleData< double, DOUBLE_TYPE > Double
SimpleData< boost::uint16_t, UINT16_TYPE > UInt16
General enumerations for the data type module.
AbstractData * StringToInt32Converter(AbstractData *d)
It converts an String data value to a Int32 data value.
This file contains several implementations for atomic data types (integers, floats, strings and others).
SimpleData< boost::int16_t, INT16_TYPE > Int16
A set of function that convert an String type to other types.
AbstractData * StringToUInt64Converter(AbstractData *d)
It converts an String data value to an unsigned Int64 data value.
SimpleData< boost::uint32_t, UINT32_TYPE > UInt32
AbstractData * StringToNumericConverter(AbstractData *d)
It converts an String data value to a Numeric data value.