diff options
author | randomdan <randomdan@localhost> | 2011-12-14 21:42:31 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2011-12-14 21:42:31 +0000 |
commit | bc8dbfb89265694cba39a5553e3ee15407587c99 (patch) | |
tree | 4b0a3414ba881a3118630c41ca24129d23f996df /project2/common/variableConvert.cpp | |
parent | Don't write JSON numbers in scientific notation, use native C++ boolalpha for... (diff) | |
download | project2-bc8dbfb89265694cba39a5553e3ee15407587c99.tar.bz2 project2-bc8dbfb89265694cba39a5553e3ee15407587c99.tar.xz project2-bc8dbfb89265694cba39a5553e3ee15407587c99.zip |
Pluggable script engines
XML script parser moved to XML module
Script parsing object multiple instantiation bug fix
Scripts changed to match new standardized format and layout
Diffstat (limited to 'project2/common/variableConvert.cpp')
-rw-r--r-- | project2/common/variableConvert.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/project2/common/variableConvert.cpp b/project2/common/variableConvert.cpp index 7eb16cf..a7ddca4 100644 --- a/project2/common/variableConvert.cpp +++ b/project2/common/variableConvert.cpp @@ -28,7 +28,7 @@ set(const VariableType * var, const T * t) return ::set(var, t, deleter<T>); } -SimpleMessageException(InvalidConversionTo); +SimpleMessage2Exception(InvalidConversionTo); class NullVariable : std::runtime_error { public: @@ -131,7 +131,7 @@ class ConvertVisitor : public boost::static_visitor<DestType> { return boost::lexical_cast<DestType>(r); } DestType operator()(const boost::posix_time::ptime &) const { - throw InvalidConversionTo(typeid(DestType).name()); + throw InvalidConversionTo(typeid(DestType).name(), "<Date Time>"); } DestType operator()(const Null &) const { throw NullVariable(); @@ -162,7 +162,7 @@ class ConvertVisitorDateTime : public boost::static_visitor<const boost::posix_t } template <typename T> const boost::posix_time::ptime & operator()(const T &) const { - throw InvalidConversionTo("DateTime"); + throw InvalidConversionTo("DateTime", typeid(T).name()); } private: const VariableType * var; @@ -176,10 +176,10 @@ class ConvertVisitorBool : public boost::static_visitor<bool> { const char * str = s.c_str(); if (strcasecmp(str, "true") == 0 || strcasecmp(str, "yes") == 0 || strcasecmp(str, "on") == 0) return true; if (strcasecmp(str, "false") == 0 || strcasecmp(str, "no") == 0 || strcasecmp(str, "off") == 0) return false; - throw InvalidConversionTo("bool"); + throw InvalidConversionTo("bool", s); } bool operator()(const boost::posix_time::ptime &) const { - throw InvalidConversionTo("bool"); + throw InvalidConversionTo("bool", "<Date time>"); } bool operator()(const Null &) const { throw NullVariable(); |