28 #ifndef __TERRALIB_LAYOUT_INTERNAL_VARIANT_H
29 #define __TERRALIB_LAYOUT_INTERNAL_VARIANT_H
33 #include "../../../../color/RGBAColor.h"
54 template <
typename ValueType>
59 std::string toString();
67 std::string convertToString();
78 template <
typename ValueType>
81 void convertValue(
const void* valueCopy);
85 bool checkNumberAsString(
const void* valueCopy);
87 double string2Double(std::string str);
89 int string2Int(std::string str);
91 float string2Float(std::string str);
93 long string2Long(std::string str);
106 template<
typename ValueType>
109 typename ValueType v = value;
110 variantSetValue(*
this, v, type);
114 template <
typename ValueType>
125 if(getType() == otherProp.
getType())
127 if(m_sValue == otherProp.
toString() &&
129 m_iValue == toInt() &&
130 m_lValue == toLong() &&
131 m_fValue == toFloat() &&
132 m_bValue == toBool())
144 if(getType() != otherProp.
getType())
149 if(getType() == otherProp.
getType())
151 if(m_sValue != otherProp.
toString() ||
153 m_iValue != toInt() ||
154 m_lValue != toLong() ||
155 m_fValue != toFloat())
161 if(m_bValue != otherProp.
toBool())
bool operator!=(const Variant &other)
te::da::Expression * operator==(const te::da::Expression &e1, const te::da::Expression &e2)
void setValue(typename ValueType value, LayoutPropertyDataType type)
te::color::RGBAColor m_colorValue
LayoutPropertyDataType m_type
te::da::Expression * operator!=(const te::da::Expression &e1, const te::da::Expression &e2)
bool operator==(const Variant &other)
LayoutPropertyDataType getType()
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
void variantSetValue(Variant &v, const typename ValueType &value, LayoutPropertyDataType type)
LayoutPropertyDataType
Enum LayoutPropertyDataType.