diff --git a/Foundation/include/Poco/DynamicAny.h b/Foundation/include/Poco/DynamicAny.h index 9ec7ec5dd..6f6300074 100644 --- a/Foundation/include/Poco/DynamicAny.h +++ b/Foundation/include/Poco/DynamicAny.h @@ -193,19 +193,21 @@ public: /// is thrown. /// Throws InvalidAccessException if DynamicAny is empty. { - if (_pHolder && _pHolder->type() == typeid(T)) - { - DynamicAnyHolderImpl* pHolderImpl = static_cast*>(_pHolder); - return pHolderImpl->value(); - } + if (_pHolder && _pHolder->type() == typeid(T)) + { + DynamicAnyHolderImpl* pHolderImpl = static_cast*>(_pHolder); + return pHolderImpl->value(); + } else if (!_pHolder) throw InvalidAccessException("Can not extract empty value."); else throw BadCastException(format("Can not convert %s to %s.", _pHolder->type().name(), - typeid(T).name())); - } - + typeid(T).name())); + } + + + template DynamicAny& operator = (const T& other) /// Assignment operator for assigning POD to DynamicAny @@ -215,7 +217,7 @@ public: return *this; } - const bool operator ! () const; + bool operator ! () const; /// Logical NOT operator. DynamicAny& operator = (const DynamicAny& other); @@ -237,13 +239,13 @@ public: DynamicAny& operator ++ (); /// Pre-increment operator - DynamicAny operator ++ (int); + const DynamicAny operator ++ (int); /// Post-increment operator DynamicAny& operator -- (); /// Pre-decrement operator - DynamicAny operator -- (int); + const DynamicAny operator -- (int); /// Post-decrement operator template @@ -518,8 +520,8 @@ private: template DynamicAnyHolderImpl* holderImpl(const std::string errorMessage = "") const { - if (_pHolder && _pHolder->type() == typeid(T)) - return static_cast*>(_pHolder); + if (_pHolder && _pHolder->type() == typeid(T)) + return static_cast*>(_pHolder); else if (!_pHolder) throw InvalidAccessException("Can not access empty value."); else @@ -538,7 +540,6 @@ private: /// /// DynamicAny members /// - inline void DynamicAny::swap(DynamicAny& ptr) { std::swap(_pHolder, ptr._pHolder); @@ -575,7 +576,7 @@ inline DynamicAny& DynamicAny::operator += (const char*other) } -inline const bool DynamicAny::operator ! () const +inline bool DynamicAny::operator ! () const { return !convert(); } @@ -626,7 +627,6 @@ inline bool DynamicAny::isString() const /// /// DynamicAny non-member functions /// - inline const DynamicAny operator + (const char* other, const DynamicAny& da) /// Addition operator for adding DynamicAny to const char* { @@ -635,28 +635,28 @@ inline const DynamicAny operator + (const char* other, const DynamicAny& da) } -inline const char operator + (const char& other, const DynamicAny& da) +inline char operator + (const char& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to char { return other + da.convert(); } -inline const char operator - (const char& other, const DynamicAny& da) +inline char operator - (const char& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from char { return other - da.convert(); } -inline const char operator * (const char& other, const DynamicAny& da) +inline char operator * (const char& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with char { return other * da.convert(); } -inline const char operator / (const char& other, const DynamicAny& da) +inline char operator / (const char& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with char { return other / da.convert(); @@ -691,7 +691,7 @@ inline char operator /= (char& other, const DynamicAny& da) } -inline const bool operator == (const char& other, const DynamicAny& da) +inline bool operator == (const char& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with char { if (da.isEmpty()) return false; @@ -699,7 +699,7 @@ inline const bool operator == (const char& other, const DynamicAny& da) } -inline const bool operator != (const char& other, const DynamicAny& da) +inline bool operator != (const char& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with char { if (da.isEmpty()) return true; @@ -707,7 +707,7 @@ inline const bool operator != (const char& other, const DynamicAny& da) } -inline const bool operator < (const char& other, const DynamicAny& da) +inline bool operator < (const char& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with char { if (da.isEmpty()) return false; @@ -715,7 +715,7 @@ inline const bool operator < (const char& other, const DynamicAny& da) } -inline const bool operator <= (const char& other, const DynamicAny& da) +inline bool operator <= (const char& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with char { if (da.isEmpty()) return false; @@ -723,7 +723,7 @@ inline const bool operator <= (const char& other, const DynamicAny& da) } -inline const bool operator > (const char& other, const DynamicAny& da) +inline bool operator > (const char& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with char { if (da.isEmpty())return false; @@ -731,7 +731,7 @@ inline const bool operator > (const char& other, const DynamicAny& da) } -inline const bool operator >= (const char& other, const DynamicAny& da) +inline bool operator >= (const char& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with char { if (da.isEmpty())return false; @@ -739,28 +739,28 @@ inline const bool operator >= (const char& other, const DynamicAny& da) } -inline const Poco::Int8 operator + (const Poco::Int8& other, const DynamicAny& da) +inline Poco::Int8 operator + (const Poco::Int8& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::Int8 { return other + da.convert(); } -inline const Poco::Int8 operator - (const Poco::Int8& other, const DynamicAny& da) +inline Poco::Int8 operator - (const Poco::Int8& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::Int8 { return other - da.convert(); } -inline const Poco::Int8 operator * (const Poco::Int8& other, const DynamicAny& da) +inline Poco::Int8 operator * (const Poco::Int8& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::Int8 { return other * da.convert(); } -inline const Poco::Int8 operator / (const Poco::Int8& other, const DynamicAny& da) +inline Poco::Int8 operator / (const Poco::Int8& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::Int8 { return other / da.convert(); @@ -795,7 +795,7 @@ inline Poco::Int8 operator /= (Poco::Int8& other, const DynamicAny& da) } -inline const bool operator == (const Poco::Int8& other, const DynamicAny& da) +inline bool operator == (const Poco::Int8& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::Int8 { if (da.isEmpty()) return false; @@ -803,7 +803,7 @@ inline const bool operator == (const Poco::Int8& other, const DynamicAny& da) } -inline const bool operator != (const Poco::Int8& other, const DynamicAny& da) +inline bool operator != (const Poco::Int8& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::Int8 { if (da.isEmpty()) return true; @@ -811,7 +811,7 @@ inline const bool operator != (const Poco::Int8& other, const DynamicAny& da) } -inline const bool operator < (const Poco::Int8& other, const DynamicAny& da) +inline bool operator < (const Poco::Int8& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::Int8 { if (da.isEmpty()) return false; @@ -819,7 +819,7 @@ inline const bool operator < (const Poco::Int8& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::Int8& other, const DynamicAny& da) +inline bool operator <= (const Poco::Int8& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::Int8 { if (da.isEmpty()) return false; @@ -827,7 +827,7 @@ inline const bool operator <= (const Poco::Int8& other, const DynamicAny& da) } -inline const bool operator > (const Poco::Int8& other, const DynamicAny& da) +inline bool operator > (const Poco::Int8& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::Int8 { if (da.isEmpty()) return false; @@ -835,7 +835,7 @@ inline const bool operator > (const Poco::Int8& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::Int8& other, const DynamicAny& da) +inline bool operator >= (const Poco::Int8& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::Int8 { if (da.isEmpty()) return false; @@ -843,28 +843,28 @@ inline const bool operator >= (const Poco::Int8& other, const DynamicAny& da) } -inline const Poco::UInt8 operator + (const Poco::UInt8& other, const DynamicAny& da) +inline Poco::UInt8 operator + (const Poco::UInt8& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::UInt8 { return other + da.convert(); } -inline const Poco::UInt8 operator - (const Poco::UInt8& other, const DynamicAny& da) +inline Poco::UInt8 operator - (const Poco::UInt8& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::UInt8 { return other - da.convert(); } -inline const Poco::UInt8 operator * (const Poco::UInt8& other, const DynamicAny& da) +inline Poco::UInt8 operator * (const Poco::UInt8& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::UInt8 { return other * da.convert(); } -inline const Poco::UInt8 operator / (const Poco::UInt8& other, const DynamicAny& da) +inline Poco::UInt8 operator / (const Poco::UInt8& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::UInt8 { return other / da.convert(); @@ -899,7 +899,7 @@ inline Poco::UInt8 operator /= (Poco::UInt8& other, const DynamicAny& da) } -inline const bool operator == (const Poco::UInt8& other, const DynamicAny& da) +inline bool operator == (const Poco::UInt8& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::UInt8 { if (da.isEmpty()) return false; @@ -907,7 +907,7 @@ inline const bool operator == (const Poco::UInt8& other, const DynamicAny& da) } -inline const bool operator != (const Poco::UInt8& other, const DynamicAny& da) +inline bool operator != (const Poco::UInt8& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::UInt8 { if (da.isEmpty()) return true; @@ -915,7 +915,7 @@ inline const bool operator != (const Poco::UInt8& other, const DynamicAny& da) } -inline const bool operator < (const Poco::UInt8& other, const DynamicAny& da) +inline bool operator < (const Poco::UInt8& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::UInt8 { if (da.isEmpty()) return false; @@ -923,7 +923,7 @@ inline const bool operator < (const Poco::UInt8& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::UInt8& other, const DynamicAny& da) +inline bool operator <= (const Poco::UInt8& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::UInt8 { if (da.isEmpty()) return false; @@ -931,7 +931,7 @@ inline const bool operator <= (const Poco::UInt8& other, const DynamicAny& da) } -inline const bool operator > (const Poco::UInt8& other, const DynamicAny& da) +inline bool operator > (const Poco::UInt8& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::UInt8 { if (da.isEmpty()) return false; @@ -939,7 +939,7 @@ inline const bool operator > (const Poco::UInt8& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::UInt8& other, const DynamicAny& da) +inline bool operator >= (const Poco::UInt8& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::UInt8 { if (da.isEmpty()) return false; @@ -947,28 +947,28 @@ inline const bool operator >= (const Poco::UInt8& other, const DynamicAny& da) } -inline const Poco::Int16 operator + (const Poco::Int16& other, const DynamicAny& da) +inline Poco::Int16 operator + (const Poco::Int16& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::Int16 { return other + da.convert(); } -inline const Poco::Int16 operator - (const Poco::Int16& other, const DynamicAny& da) +inline Poco::Int16 operator - (const Poco::Int16& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::Int16 { return other - da.convert(); } -inline const Poco::Int16 operator * (const Poco::Int16& other, const DynamicAny& da) +inline Poco::Int16 operator * (const Poco::Int16& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::Int16 { return other * da.convert(); } -inline const Poco::Int16 operator / (const Poco::Int16& other, const DynamicAny& da) +inline Poco::Int16 operator / (const Poco::Int16& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::Int16 { return other / da.convert(); @@ -1003,7 +1003,7 @@ inline Poco::Int16 operator /= (Poco::Int16& other, const DynamicAny& da) } -inline const bool operator == (const Poco::Int16& other, const DynamicAny& da) +inline bool operator == (const Poco::Int16& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::Int16 { if (da.isEmpty()) return false; @@ -1011,7 +1011,7 @@ inline const bool operator == (const Poco::Int16& other, const DynamicAny& da) } -inline const bool operator != (const Poco::Int16& other, const DynamicAny& da) +inline bool operator != (const Poco::Int16& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::Int16 { if (da.isEmpty()) return true; @@ -1019,7 +1019,7 @@ inline const bool operator != (const Poco::Int16& other, const DynamicAny& da) } -inline const bool operator < (const Poco::Int16& other, const DynamicAny& da) +inline bool operator < (const Poco::Int16& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::Int16 { if (da.isEmpty()) return false; @@ -1027,7 +1027,7 @@ inline const bool operator < (const Poco::Int16& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::Int16& other, const DynamicAny& da) +inline bool operator <= (const Poco::Int16& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::Int16 { if (da.isEmpty()) return false; @@ -1035,7 +1035,7 @@ inline const bool operator <= (const Poco::Int16& other, const DynamicAny& da) } -inline const bool operator > (const Poco::Int16& other, const DynamicAny& da) +inline bool operator > (const Poco::Int16& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::Int16 { if (da.isEmpty()) return false; @@ -1043,7 +1043,7 @@ inline const bool operator > (const Poco::Int16& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::Int16& other, const DynamicAny& da) +inline bool operator >= (const Poco::Int16& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::Int16 { if (da.isEmpty()) return false; @@ -1051,28 +1051,28 @@ inline const bool operator >= (const Poco::Int16& other, const DynamicAny& da) } -inline const Poco::UInt16 operator + (const Poco::UInt16& other, const DynamicAny& da) +inline Poco::UInt16 operator + (const Poco::UInt16& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::UInt16 { return other + da.convert(); } -inline const Poco::UInt16 operator - (const Poco::UInt16& other, const DynamicAny& da) +inline Poco::UInt16 operator - (const Poco::UInt16& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::UInt16 { return other - da.convert(); } -inline const Poco::UInt16 operator * (const Poco::UInt16& other, const DynamicAny& da) +inline Poco::UInt16 operator * (const Poco::UInt16& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::UInt16 { return other * da.convert(); } -inline const Poco::UInt16 operator / (const Poco::UInt16& other, const DynamicAny& da) +inline Poco::UInt16 operator / (const Poco::UInt16& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::UInt16 { return other / da.convert(); @@ -1107,7 +1107,7 @@ inline Poco::UInt16 operator /= (Poco::UInt16& other, const DynamicAny& da) } -inline const bool operator == (const Poco::UInt16& other, const DynamicAny& da) +inline bool operator == (const Poco::UInt16& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::UInt16 { if (da.isEmpty()) return false; @@ -1115,7 +1115,7 @@ inline const bool operator == (const Poco::UInt16& other, const DynamicAny& da) } -inline const bool operator != (const Poco::UInt16& other, const DynamicAny& da) +inline bool operator != (const Poco::UInt16& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::UInt16 { if (da.isEmpty()) return true; @@ -1123,7 +1123,7 @@ inline const bool operator != (const Poco::UInt16& other, const DynamicAny& da) } -inline const bool operator < (const Poco::UInt16& other, const DynamicAny& da) +inline bool operator < (const Poco::UInt16& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::UInt16 { if (da.isEmpty()) return false; @@ -1131,7 +1131,7 @@ inline const bool operator < (const Poco::UInt16& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::UInt16& other, const DynamicAny& da) +inline bool operator <= (const Poco::UInt16& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::UInt16 { if (da.isEmpty()) return false; @@ -1139,7 +1139,7 @@ inline const bool operator <= (const Poco::UInt16& other, const DynamicAny& da) } -inline const bool operator > (const Poco::UInt16& other, const DynamicAny& da) +inline bool operator > (const Poco::UInt16& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::UInt16 { if (da.isEmpty()) return false; @@ -1147,7 +1147,7 @@ inline const bool operator > (const Poco::UInt16& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::UInt16& other, const DynamicAny& da) +inline bool operator >= (const Poco::UInt16& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::UInt16 { if (da.isEmpty()) return false; @@ -1155,28 +1155,28 @@ inline const bool operator >= (const Poco::UInt16& other, const DynamicAny& da) } -inline const Poco::Int32 operator + (const Poco::Int32& other, const DynamicAny& da) +inline Poco::Int32 operator + (const Poco::Int32& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::Int32 { return other + da.convert(); } -inline const Poco::Int32 operator - (const Poco::Int32& other, const DynamicAny& da) +inline Poco::Int32 operator - (const Poco::Int32& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::Int32 { return other - da.convert(); } -inline const Poco::Int32 operator * (const Poco::Int32& other, const DynamicAny& da) +inline Poco::Int32 operator * (const Poco::Int32& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::Int32 { return other * da.convert(); } -inline const Poco::Int32 operator / (const Poco::Int32& other, const DynamicAny& da) +inline Poco::Int32 operator / (const Poco::Int32& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::Int32 { return other / da.convert(); @@ -1211,7 +1211,7 @@ inline Poco::Int32 operator /= (Poco::Int32& other, const DynamicAny& da) } -inline const bool operator == (const Poco::Int32& other, const DynamicAny& da) +inline bool operator == (const Poco::Int32& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::Int32 { if (da.isEmpty()) return false; @@ -1219,7 +1219,7 @@ inline const bool operator == (const Poco::Int32& other, const DynamicAny& da) } -inline const bool operator != (const Poco::Int32& other, const DynamicAny& da) +inline bool operator != (const Poco::Int32& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::Int32 { if (da.isEmpty()) return true; @@ -1227,7 +1227,7 @@ inline const bool operator != (const Poco::Int32& other, const DynamicAny& da) } -inline const bool operator < (const Poco::Int32& other, const DynamicAny& da) +inline bool operator < (const Poco::Int32& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::Int32 { if (da.isEmpty()) return false; @@ -1235,7 +1235,7 @@ inline const bool operator < (const Poco::Int32& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::Int32& other, const DynamicAny& da) +inline bool operator <= (const Poco::Int32& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::Int32 { if (da.isEmpty()) return false; @@ -1243,7 +1243,7 @@ inline const bool operator <= (const Poco::Int32& other, const DynamicAny& da) } -inline const bool operator > (const Poco::Int32& other, const DynamicAny& da) +inline bool operator > (const Poco::Int32& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::Int32 { if (da.isEmpty()) return false; @@ -1251,7 +1251,7 @@ inline const bool operator > (const Poco::Int32& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::Int32& other, const DynamicAny& da) +inline bool operator >= (const Poco::Int32& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::Int32 { if (da.isEmpty()) return false; @@ -1259,28 +1259,28 @@ inline const bool operator >= (const Poco::Int32& other, const DynamicAny& da) } -inline const Poco::UInt32 operator + (const Poco::UInt32& other, const DynamicAny& da) +inline Poco::UInt32 operator + (const Poco::UInt32& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::UInt32 { return other + da.convert(); } -inline const Poco::UInt32 operator - (const Poco::UInt32& other, const DynamicAny& da) +inline Poco::UInt32 operator - (const Poco::UInt32& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::UInt32 { return other - da.convert(); } -inline const Poco::UInt32 operator * (const Poco::UInt32& other, const DynamicAny& da) +inline Poco::UInt32 operator * (const Poco::UInt32& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::UInt32 { return other * da.convert(); } -inline const Poco::UInt32 operator / (const Poco::UInt32& other, const DynamicAny& da) +inline Poco::UInt32 operator / (const Poco::UInt32& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::UInt32 { return other / da.convert(); @@ -1315,7 +1315,7 @@ inline Poco::UInt32 operator /= (Poco::UInt32& other, const DynamicAny& da) } -inline const bool operator == (const Poco::UInt32& other, const DynamicAny& da) +inline bool operator == (const Poco::UInt32& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::UInt32 { if (da.isEmpty()) return false; @@ -1323,7 +1323,7 @@ inline const bool operator == (const Poco::UInt32& other, const DynamicAny& da) } -inline const bool operator != (const Poco::UInt32& other, const DynamicAny& da) +inline bool operator != (const Poco::UInt32& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::UInt32 { if (da.isEmpty()) return true; @@ -1331,7 +1331,7 @@ inline const bool operator != (const Poco::UInt32& other, const DynamicAny& da) } -inline const bool operator < (const Poco::UInt32& other, const DynamicAny& da) +inline bool operator < (const Poco::UInt32& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::UInt32 { if (da.isEmpty()) return false; @@ -1339,7 +1339,7 @@ inline const bool operator < (const Poco::UInt32& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::UInt32& other, const DynamicAny& da) +inline bool operator <= (const Poco::UInt32& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::UInt32 { if (da.isEmpty()) return false; @@ -1347,7 +1347,7 @@ inline const bool operator <= (const Poco::UInt32& other, const DynamicAny& da) } -inline const bool operator > (const Poco::UInt32& other, const DynamicAny& da) +inline bool operator > (const Poco::UInt32& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::UInt32 { if (da.isEmpty()) return false; @@ -1355,7 +1355,7 @@ inline const bool operator > (const Poco::UInt32& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::UInt32& other, const DynamicAny& da) +inline bool operator >= (const Poco::UInt32& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::UInt32 { if (da.isEmpty()) return false; @@ -1363,28 +1363,28 @@ inline const bool operator >= (const Poco::UInt32& other, const DynamicAny& da) } -inline const Poco::Int64 operator + (const Poco::Int64& other, const DynamicAny& da) +inline Poco::Int64 operator + (const Poco::Int64& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::Int64 { return other + da.convert(); } -inline const Poco::Int64 operator - (const Poco::Int64& other, const DynamicAny& da) +inline Poco::Int64 operator - (const Poco::Int64& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::Int64 { return other - da.convert(); } -inline const Poco::Int64 operator * (const Poco::Int64& other, const DynamicAny& da) +inline Poco::Int64 operator * (const Poco::Int64& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::Int64 { return other * da.convert(); } -inline const Poco::Int64 operator / (const Poco::Int64& other, const DynamicAny& da) +inline Poco::Int64 operator / (const Poco::Int64& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::Int64 { return other / da.convert(); @@ -1419,7 +1419,7 @@ inline Poco::Int64 operator /= (Poco::Int64& other, const DynamicAny& da) } -inline const bool operator == (const Poco::Int64& other, const DynamicAny& da) +inline bool operator == (const Poco::Int64& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::Int64 { if (da.isEmpty()) return false; @@ -1427,7 +1427,7 @@ inline const bool operator == (const Poco::Int64& other, const DynamicAny& da) } -inline const bool operator != (const Poco::Int64& other, const DynamicAny& da) +inline bool operator != (const Poco::Int64& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::Int64 { if (da.isEmpty()) return true; @@ -1435,7 +1435,7 @@ inline const bool operator != (const Poco::Int64& other, const DynamicAny& da) } -inline const bool operator < (const Poco::Int64& other, const DynamicAny& da) +inline bool operator < (const Poco::Int64& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::Int64 { if (da.isEmpty()) return false; @@ -1443,7 +1443,7 @@ inline const bool operator < (const Poco::Int64& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::Int64& other, const DynamicAny& da) +inline bool operator <= (const Poco::Int64& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::Int64 { if (da.isEmpty()) return false; @@ -1451,7 +1451,7 @@ inline const bool operator <= (const Poco::Int64& other, const DynamicAny& da) } -inline const bool operator > (const Poco::Int64& other, const DynamicAny& da) +inline bool operator > (const Poco::Int64& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::Int64 { if (da.isEmpty()) return false; @@ -1459,7 +1459,7 @@ inline const bool operator > (const Poco::Int64& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::Int64& other, const DynamicAny& da) +inline bool operator >= (const Poco::Int64& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::Int64 { if (da.isEmpty()) return false; @@ -1467,28 +1467,28 @@ inline const bool operator >= (const Poco::Int64& other, const DynamicAny& da) } -inline const Poco::UInt64 operator + (const Poco::UInt64& other, const DynamicAny& da) +inline Poco::UInt64 operator + (const Poco::UInt64& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to Poco::UInt64 { return other + da.convert(); } -inline const Poco::UInt64 operator - (const Poco::UInt64& other, const DynamicAny& da) +inline Poco::UInt64 operator - (const Poco::UInt64& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from Poco::UInt64 { return other - da.convert(); } -inline const Poco::UInt64 operator * (const Poco::UInt64& other, const DynamicAny& da) +inline Poco::UInt64 operator * (const Poco::UInt64& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with Poco::UInt64 { return other * da.convert(); } -inline const Poco::UInt64 operator / (const Poco::UInt64& other, const DynamicAny& da) +inline Poco::UInt64 operator / (const Poco::UInt64& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with Poco::UInt64 { return other / da.convert(); @@ -1523,7 +1523,7 @@ inline Poco::UInt64 operator /= (Poco::UInt64& other, const DynamicAny& da) } -inline const bool operator == (const Poco::UInt64& other, const DynamicAny& da) +inline bool operator == (const Poco::UInt64& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with Poco::UInt64 { if (da.isEmpty()) return false; @@ -1531,7 +1531,7 @@ inline const bool operator == (const Poco::UInt64& other, const DynamicAny& da) } -inline const bool operator != (const Poco::UInt64& other, const DynamicAny& da) +inline bool operator != (const Poco::UInt64& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with Poco::UInt64 { if (da.isEmpty()) return true; @@ -1539,7 +1539,7 @@ inline const bool operator != (const Poco::UInt64& other, const DynamicAny& da) } -inline const bool operator < (const Poco::UInt64& other, const DynamicAny& da) +inline bool operator < (const Poco::UInt64& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with Poco::UInt64 { if (da.isEmpty()) return false; @@ -1547,7 +1547,7 @@ inline const bool operator < (const Poco::UInt64& other, const DynamicAny& da) } -inline const bool operator <= (const Poco::UInt64& other, const DynamicAny& da) +inline bool operator <= (const Poco::UInt64& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with Poco::UInt64 { if (da.isEmpty()) return false; @@ -1555,7 +1555,7 @@ inline const bool operator <= (const Poco::UInt64& other, const DynamicAny& da) } -inline const bool operator > (const Poco::UInt64& other, const DynamicAny& da) +inline bool operator > (const Poco::UInt64& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with Poco::UInt64 { if (da.isEmpty()) return false; @@ -1563,7 +1563,7 @@ inline const bool operator > (const Poco::UInt64& other, const DynamicAny& da) } -inline const bool operator >= (const Poco::UInt64& other, const DynamicAny& da) +inline bool operator >= (const Poco::UInt64& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with Poco::UInt64 { if (da.isEmpty()) return false; @@ -1571,28 +1571,28 @@ inline const bool operator >= (const Poco::UInt64& other, const DynamicAny& da) } -inline const float operator + (const float& other, const DynamicAny& da) +inline float operator + (const float& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to float { return other + da.convert(); } -inline const float operator - (const float& other, const DynamicAny& da) +inline float operator - (const float& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from float { return other - da.convert(); } -inline const float operator * (const float& other, const DynamicAny& da) +inline float operator * (const float& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with float { return other * da.convert(); } -inline const float operator / (const float& other, const DynamicAny& da) +inline float operator / (const float& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with float { return other / da.convert(); @@ -1627,7 +1627,7 @@ inline float operator /= (float& other, const DynamicAny& da) } -inline const bool operator == (const float& other, const DynamicAny& da) +inline bool operator == (const float& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with float { if (da.isEmpty()) return false; @@ -1635,7 +1635,7 @@ inline const bool operator == (const float& other, const DynamicAny& da) } -inline const bool operator != (const float& other, const DynamicAny& da) +inline bool operator != (const float& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with float { if (da.isEmpty()) return true; @@ -1643,7 +1643,7 @@ inline const bool operator != (const float& other, const DynamicAny& da) } -inline const bool operator < (const float& other, const DynamicAny& da) +inline bool operator < (const float& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with float { if (da.isEmpty()) return false; @@ -1651,7 +1651,7 @@ inline const bool operator < (const float& other, const DynamicAny& da) } -inline const bool operator <= (const float& other, const DynamicAny& da) +inline bool operator <= (const float& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with float { if (da.isEmpty()) return false; @@ -1659,7 +1659,7 @@ inline const bool operator <= (const float& other, const DynamicAny& da) } -inline const bool operator > (const float& other, const DynamicAny& da) +inline bool operator > (const float& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with float { if (da.isEmpty()) return false; @@ -1667,7 +1667,7 @@ inline const bool operator > (const float& other, const DynamicAny& da) } -inline const bool operator >= (const float& other, const DynamicAny& da) +inline bool operator >= (const float& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with float { if (da.isEmpty()) return false; @@ -1675,28 +1675,28 @@ inline const bool operator >= (const float& other, const DynamicAny& da) } -inline const double operator + (const double& other, const DynamicAny& da) +inline double operator + (const double& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to double { return other + da.convert(); } -inline const double operator - (const double& other, const DynamicAny& da) +inline double operator - (const double& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from double { return other - da.convert(); } -inline const double operator * (const double& other, const DynamicAny& da) +inline double operator * (const double& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with double { return other * da.convert(); } -inline const double operator / (const double& other, const DynamicAny& da) +inline double operator / (const double& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with double { return other / da.convert(); @@ -1731,7 +1731,7 @@ inline double operator /= (double& other, const DynamicAny& da) } -inline const bool operator == (const double& other, const DynamicAny& da) +inline bool operator == (const double& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with double { if (da.isEmpty()) return false; @@ -1739,7 +1739,7 @@ inline const bool operator == (const double& other, const DynamicAny& da) } -inline const bool operator != (const double& other, const DynamicAny& da) +inline bool operator != (const double& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with double { if (da.isEmpty()) return true; @@ -1747,7 +1747,7 @@ inline const bool operator != (const double& other, const DynamicAny& da) } -inline const bool operator < (const double& other, const DynamicAny& da) +inline bool operator < (const double& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with double { if (da.isEmpty()) return false; @@ -1755,7 +1755,7 @@ inline const bool operator < (const double& other, const DynamicAny& da) } -inline const bool operator <= (const double& other, const DynamicAny& da) +inline bool operator <= (const double& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with double { if (da.isEmpty()) return false; @@ -1763,7 +1763,7 @@ inline const bool operator <= (const double& other, const DynamicAny& da) } -inline const bool operator > (const double& other, const DynamicAny& da) +inline bool operator > (const double& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with double { if (da.isEmpty()) return false; @@ -1771,7 +1771,7 @@ inline const bool operator > (const double& other, const DynamicAny& da) } -inline const bool operator >= (const double& other, const DynamicAny& da) +inline bool operator >= (const double& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with double { if (da.isEmpty()) return false; @@ -1779,7 +1779,7 @@ inline const bool operator >= (const double& other, const DynamicAny& da) } -inline const bool operator == (const bool& other, const DynamicAny& da) +inline bool operator == (const bool& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with bool { if (da.isEmpty()) return false; @@ -1787,7 +1787,7 @@ inline const bool operator == (const bool& other, const DynamicAny& da) } -inline const bool operator != (const bool& other, const DynamicAny& da) +inline bool operator != (const bool& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with bool { if (da.isEmpty()) return true; @@ -1795,7 +1795,7 @@ inline const bool operator != (const bool& other, const DynamicAny& da) } -inline const bool operator == (const std::string& other, const DynamicAny& da) +inline bool operator == (const std::string& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with std::string { if (da.isEmpty()) return false; @@ -1803,7 +1803,7 @@ inline const bool operator == (const std::string& other, const DynamicAny& da) } -inline const bool operator != (const std::string& other, const DynamicAny& da) +inline bool operator != (const std::string& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with std::string { if (da.isEmpty()) return true; @@ -1811,7 +1811,7 @@ inline const bool operator != (const std::string& other, const DynamicAny& da) } -inline const bool operator == (const char* other, const DynamicAny& da) +inline bool operator == (const char* other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with const char* { if (da.isEmpty()) return false; @@ -1819,7 +1819,7 @@ inline const bool operator == (const char* other, const DynamicAny& da) } -inline const bool operator != (const char* other, const DynamicAny& da) +inline bool operator != (const char* other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with const char* { if (da.isEmpty()) return true; @@ -1830,28 +1830,28 @@ inline const bool operator != (const char* other, const DynamicAny& da) #ifndef POCO_LONG_IS_64_BIT -inline const long operator + (const long& other, const DynamicAny& da) +inline long operator + (const long& other, const DynamicAny& da) /// Addition operator for adding DynamicAny to long { return other + da.convert(); } -inline const long operator - (const long& other, const DynamicAny& da) +inline long operator - (const long& other, const DynamicAny& da) /// Subtraction operator for subtracting DynamicAny from long { return other - da.convert(); } -inline const long operator * (const long& other, const DynamicAny& da) +inline long operator * (const long& other, const DynamicAny& da) /// Multiplication operator for multiplying DynamicAny with long { return other * da.convert(); } -inline const long operator / (const long& other, const DynamicAny& da) +inline long operator / (const long& other, const DynamicAny& da) /// Division operator for dividing DynamicAny with long { return other / da.convert(); @@ -1886,7 +1886,7 @@ inline long operator /= (long& other, const DynamicAny& da) } -inline const bool operator == (const long& other, const DynamicAny& da) +inline bool operator == (const long& other, const DynamicAny& da) /// Equality operator for comparing DynamicAny with long { if (da.isEmpty()) return false; @@ -1894,7 +1894,7 @@ inline const bool operator == (const long& other, const DynamicAny& da) } -inline const bool operator != (const long& other, const DynamicAny& da) +inline bool operator != (const long& other, const DynamicAny& da) /// Inequality operator for comparing DynamicAny with long { if (da.isEmpty()) return true; @@ -1902,7 +1902,7 @@ inline const bool operator != (const long& other, const DynamicAny& da) } -inline const bool operator < (const long& other, const DynamicAny& da) +inline bool operator < (const long& other, const DynamicAny& da) /// Less than operator for comparing DynamicAny with long { if (da.isEmpty()) return false; @@ -1910,7 +1910,7 @@ inline const bool operator < (const long& other, const DynamicAny& da) } -inline const bool operator <= (const long& other, const DynamicAny& da) +inline bool operator <= (const long& other, const DynamicAny& da) /// Less than or equal operator for comparing DynamicAny with long { if (da.isEmpty()) return false; @@ -1918,7 +1918,7 @@ inline const bool operator <= (const long& other, const DynamicAny& da) } -inline const bool operator > (const long& other, const DynamicAny& da) +inline bool operator > (const long& other, const DynamicAny& da) /// Greater than operator for comparing DynamicAny with long { if (da.isEmpty()) return false; @@ -1926,7 +1926,7 @@ inline const bool operator > (const long& other, const DynamicAny& da) } -inline const bool operator >= (const long& other, const DynamicAny& da) +inline bool operator >= (const long& other, const DynamicAny& da) /// Greater than or equal operator for comparing DynamicAny with long { if (da.isEmpty()) return false; diff --git a/Foundation/src/DynamicAny.cpp b/Foundation/src/DynamicAny.cpp index fb42d0243..2644fbbf6 100644 --- a/Foundation/src/DynamicAny.cpp +++ b/Foundation/src/DynamicAny.cpp @@ -216,7 +216,7 @@ DynamicAny& DynamicAny::operator ++ () return *this = *this + 1; } -DynamicAny DynamicAny::operator ++ (int) +const DynamicAny DynamicAny::operator ++ (int) { if (!isInteger()) throw InvalidArgumentException("Invalid operation for this data type."); @@ -234,7 +234,7 @@ DynamicAny& DynamicAny::operator -- () return *this = *this - 1; } -DynamicAny DynamicAny::operator -- (int) +const DynamicAny DynamicAny::operator -- (int) { if (!isInteger()) throw InvalidArgumentException("Invalid operation for this data type.");