28 template <
class T,
class F>
29 inline void set( T& _to,
const F& fr )
32 template <
class T,
class F>
33 inline T
to(
const F& fr )
44 template <
class T,
class F>
56 template <
class T,
class F>
61 udfset<T,F>(ret,fr,und);
70 inline void set(
const char*& _to,
const od_int32& i )
74 inline void set(
const char*& _to,
const od_uint32& i )
78 inline void set(
const char*& _to,
const od_int64& i )
82 inline void set(
const char*& _to,
const od_uint64& i )
86 inline void set(
const char*& _to,
const bool& b )
90 inline void set(
const char*& _to,
const float& f )
94 inline void set(
const char*& _to,
const double& d )
98 inline void set(
const char*& _to,
const short& i )
102 inline void set(
const char*& _to,
const unsigned short& i )
117 inline void set(
short& _to,
const float& f )
121 inline void set(
unsigned short& _to,
const float& f )
141 inline void set(
short& _to,
const double& f )
145 inline void set(
unsigned short& _to,
const double& f )
160 inline void set(
bool& _to,
const char*
const& s )
168 inline void set(
bool& _to,
const int& i )
172 inline void set(
bool& _to,
const float& f )
176 inline void set(
bool& _to,
const double& d )
183 #define mConvDeclFromStrToSimpleType(type) \ 184 template <> mGlobal(Basic) void set(type&,const char* const&); \ 185 template <> mGlobal(Basic) void set(type&,const FixedString&) 201 #define mConvDefFromStrToSimpleType(type,function) \ 204 template <> void set( type& _to, const char* const& s ) \ 206 if ( !s || !*s ) { return; } \ 209 type tmpval = (type) function; \ 211 _to = (type) tmpval; \ 212 else if ( Values::Undef<type>::hasUdf() ) \ 213 Values::setUdf( _to ); \ 215 template <> void set( type& _to, const FixedString& s ) \ 217 if ( !s ) { return; } \ 220 type tmpval = (type) function; \ 221 if ( s.str() != endptr ) \ 222 _to = (type) tmpval; \ 223 else if ( Values::Undef<type>::hasUdf() ) \ 224 Values::setUdf( _to ); \
T to(const F &fr)
Definition: convert.h:33
T udfto(const F &fr, const T &und=Values::Undef< T >::val())
Definition: convert.h:57
#define mRounded(typ, x)
Definition: commondefs.h:44
#define mIsZero(x, eps)
Definition: commondefs.h:53
OD::String that holds an existing text string.
Definition: fixedstring.h:29
#define od_int64
Definition: plftypes.h:36
bool yesNoFromString(const char *)
#define od_uint32
Definition: plftypes.h:32
#define mDefEpsD
Definition: commondefs.h:57
#define od_uint64
Definition: plftypes.h:37
#define mDefEpsF
Definition: commondefs.h:56
void udfset(T &_to, const F &fr, const T &und=Values::Undef< T >::val())
template based type converstion, with check for undef
Definition: convert.h:45
#define od_int32
Definition: plftypes.h:31
#define mConvDeclFromStrToSimpleType(type)
Definition: convert.h:183
T & setUdf(T &u)
Definition: undefval.h:262
#define od_uint16
Definition: plftypes.h:28
Template based type conversion.
Definition: convert.h:24
bool isUdf(const T &t)
Definition: undefval.h:243
Export_Basic const char * toString(ViewStyle)
Templatized undefined values.
Definition: undefval.h:51