51 static inline int convertFromReal(
int,
Real v)
59 static inline unsigned int convertFromReal(
unsigned int,
Real v)
67 static inline long convertFromReal(
long,
Real v)
75 static inline unsigned long convertFromReal(
unsigned long,
Real v)
83 static inline long long convertFromReal(
long long,
Real v)
91 static inline unsigned long long convertFromReal(
unsigned long long,
Real v)
106 , m_bool_value(
false)
107 , m_sticky_type(TUnknown)
113 , m_bool_value(
false)
114 , m_sticky_type(TReal)
116 SmallVariant(
Int32 v)
120 , m_bool_value(
false)
121 , m_sticky_type(TInt32)
123 SmallVariant(
Int64 v)
127 , m_bool_value(
false)
128 , m_sticky_type(TInt64)
135 , m_sticky_type(TBool)
137 SmallVariant(
const String& v)
141 , m_bool_value(
false)
143 , m_sticky_type(TString)
146 void setValue(
Real v)
149 m_sticky_type = TReal;
151 void setValue(
Int32 v)
154 m_sticky_type = TInt32;
156 void setValue(
Int64 v)
159 m_sticky_type = TInt64;
161 void setValue(
const String& v)
164 m_sticky_type = TString;
166 void setValue(
bool v)
169 m_sticky_type = TBool;
172 void setValueAll(
Real v)
174 m_sticky_type = TReal;
176 m_int32_value = convertFromReal(m_int32_value, v);
177 m_int64_value = convertFromReal(m_int64_value, v);
178 m_bool_value = v != 0.;
179 m_string_value = String::fromNumber(m_real_value);
181 void setValueAll(
Int32 v)
183 m_sticky_type = TInt32;
186 m_int64_value = (
Int64)(v);
187 m_bool_value = v != 0;
188 m_string_value = String::fromNumber(m_int32_value);
190 void setValueAll(
Int64 v)
192 m_sticky_type = TInt64;
194 m_int32_value = (
Int32)(v);
196 m_bool_value = v != 0;
197 m_string_value = String::fromNumber(m_int64_value);
199 void setValueAll(
bool v)
201 m_sticky_type = TBool;
203 m_int32_value = v ? 1 : 0;
204 m_int64_value = v ? 1 : 0;
206 m_string_value = String::fromNumber(m_int64_value);
209 void value(
bool& v)
const { v = m_bool_value; }
210 void value(
Real& v)
const { v = m_real_value; }
211 void value(
Int32& v)
const { v = m_int32_value; }
212 void value(
Int64& v)
const { v = m_int64_value; }
213 void value(
String& v)
const { v = m_string_value; }
215 bool asBool()
const {
return m_bool_value; }
216 Real asReal()
const {
return m_real_value; }
218 Int32 asInt32()
const {
return m_int32_value; }
219 Int64 asInt64()
const {
return m_int64_value; }
220 const String& asString()
const {
return m_string_value; }
221 eType type()
const {
return m_sticky_type; }