Core: Value vtype tests

git-svn-id: svn://ultimatepp.org/upp/trunk@2918 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2010-12-22 09:51:50 +00:00
parent b8573dea32
commit 11ffa2c192
2 changed files with 10 additions and 1 deletions

View file

@ -30,7 +30,6 @@ template<> inline String AsString(const long& a) { return FormatInt64
template<> inline String AsString(const unsigned long& a) { return Format64(a); }
template<> inline String AsString(const double& a) { return FormatDouble(a); }
template<> inline String AsString(const float& a) { return FormatDouble(a); }
//template<> inline String AsString(const bool& a) { return FormatBool(a); } // TRC: moved to String.h by CXL
template<> inline String AsString(const int64& a) { return FormatInt64(a); }
template<> inline String AsString(const uint64& a) { return Format64(a); }

View file

@ -206,6 +206,16 @@ inline bool operator==(const wchar *x, const Value& v) { return (WString)v == x
inline bool operator!=(const Value& v, const wchar *x) { return (WString)v != x; }
inline bool operator!=(const wchar *x, const Value& v) { return (WString)v != x; }
inline bool IsVoidValueTypeNo(int q) { return q == VOID_V; }
inline bool IsErrorValueTypeNo(int q) { return q == ERROR_V; }
inline bool IsStringValueTypeNo(int q) { return q == STRING_V || q == WSTRING_V; }
inline bool IsIntegerValueTypeNo(int q) { return q == INT_V || q == INT64_V || q == BOOL_V; }
inline bool IsFloatValueTypeNo(int q) { return q == DOUBLE_V; }
inline bool IsNumberValueTypeNo(int q) { return IsIntegerValueTypeNo(q) || IsFloatValueTypeNo(q); }
inline bool IsDateTimeValueTypeNo(int q) { return q == DATE_V || q == TIME_V; }
inline bool IsVoid(const Value& v) { return v.GetType() == VOID_V; }
inline bool IsError(const Value& v) { return v.GetType() == ERROR_V; }
inline bool IsString(const Value& v) { return v.GetType() == STRING_V || v.GetType() == WSTRING_V; }