mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-12-23 00:17:21 +01:00
Update POCO to 1.11.0
This commit is contained in:
@@ -116,7 +116,7 @@ public:
|
||||
~VarHolderImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return typeid(Pair<std::string>);
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to Int16");
|
||||
}
|
||||
|
||||
|
||||
void convert(Int32& val) const
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to Int32");
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to UInt16");
|
||||
}
|
||||
|
||||
|
||||
void convert(UInt32& val) const
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to UInt32");
|
||||
@@ -189,9 +189,9 @@ public:
|
||||
val.append("{ ");
|
||||
Var key(_val.first());
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, _val.second());
|
||||
val.append(" }");
|
||||
val.append(" }");
|
||||
}
|
||||
|
||||
void convert(Poco::DateTime&) const
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
{
|
||||
return cloneHolder(pVarHolder, _val);
|
||||
}
|
||||
|
||||
|
||||
const Pair<std::string>& value() const
|
||||
{
|
||||
return _val;
|
||||
@@ -265,7 +265,7 @@ public:
|
||||
~VarHolderImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return typeid(Pair<int>);
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to Int16");
|
||||
}
|
||||
|
||||
|
||||
void convert(Int32& val) const
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to Int32");
|
||||
@@ -300,7 +300,7 @@ public:
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to UInt16");
|
||||
}
|
||||
|
||||
|
||||
void convert(UInt32& val) const
|
||||
{
|
||||
throw BadCastException("Cannot cast Pair type to UInt32");
|
||||
@@ -338,9 +338,9 @@ public:
|
||||
val.append("{ ");
|
||||
Var key(_val.first());
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, _val.second());
|
||||
val.append(" }");
|
||||
val.append(" }");
|
||||
}
|
||||
|
||||
void convert(Poco::DateTime&) const
|
||||
@@ -362,7 +362,7 @@ public:
|
||||
{
|
||||
return cloneHolder(pVarHolder, _val);
|
||||
}
|
||||
|
||||
|
||||
const Pair<int>& value() const
|
||||
{
|
||||
return _val;
|
||||
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
{
|
||||
_data.clear();
|
||||
}
|
||||
|
||||
|
||||
inline void swap(Struct& other)
|
||||
/// Swap content of Struct with another Struct
|
||||
{
|
||||
@@ -264,7 +264,7 @@ public:
|
||||
~VarHolderImpl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return typeid(ValueType);
|
||||
@@ -279,7 +279,7 @@ public:
|
||||
{
|
||||
throw BadCastException("Cannot cast Struct type to Int16");
|
||||
}
|
||||
|
||||
|
||||
void convert(Int32&) const
|
||||
{
|
||||
throw BadCastException("Cannot cast Struct type to Int32");
|
||||
@@ -299,7 +299,7 @@ public:
|
||||
{
|
||||
throw BadCastException("Cannot cast Struct type to UInt16");
|
||||
}
|
||||
|
||||
|
||||
void convert(UInt32&) const
|
||||
{
|
||||
throw BadCastException("Cannot cast Struct type to UInt32");
|
||||
@@ -339,7 +339,7 @@ public:
|
||||
{
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
++it;
|
||||
}
|
||||
@@ -348,7 +348,7 @@ public:
|
||||
val.append(", ");
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
}
|
||||
val.append(" }");
|
||||
@@ -373,7 +373,7 @@ public:
|
||||
{
|
||||
return cloneHolder(pVarHolder, _val);
|
||||
}
|
||||
|
||||
|
||||
const ValueType& value() const
|
||||
{
|
||||
return _val;
|
||||
@@ -413,7 +413,7 @@ public:
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
std::size_t size() const
|
||||
{
|
||||
return _val.size();
|
||||
@@ -525,7 +525,7 @@ public:
|
||||
{
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
++it;
|
||||
}
|
||||
@@ -534,7 +534,7 @@ public:
|
||||
val.append(", ");
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
}
|
||||
val.append(" }");
|
||||
@@ -711,7 +711,7 @@ public:
|
||||
{
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
++it;
|
||||
}
|
||||
@@ -720,7 +720,7 @@ public:
|
||||
val.append(", ");
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
}
|
||||
val.append(" }");
|
||||
@@ -897,7 +897,7 @@ public:
|
||||
{
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
++it;
|
||||
}
|
||||
@@ -906,7 +906,7 @@ public:
|
||||
val.append(", ");
|
||||
Var key(it->first);
|
||||
Impl::appendJSONKey(val, key);
|
||||
val.append(" : ");
|
||||
val.append(": ");
|
||||
Impl::appendJSONValue(val, it->second);
|
||||
}
|
||||
val.append(" }");
|
||||
|
||||
@@ -523,6 +523,9 @@ public:
|
||||
bool isDateTime() const;
|
||||
/// Returns true if stored value represents a date/time.
|
||||
|
||||
bool isUUID() const;
|
||||
/// Returns true if stored value is a Poco::UUID.
|
||||
|
||||
std::size_t size() const;
|
||||
/// Returns the size of this Var.
|
||||
/// This function returns 0 when Var is empty, 1 for POD or the size (i.e. length)
|
||||
@@ -737,7 +740,7 @@ inline const std::type_info& Var::type() const
|
||||
|
||||
inline Var::ConstIterator Var::begin() const
|
||||
{
|
||||
if (isEmpty()) return ConstIterator(const_cast<Var*>(this), true);
|
||||
if (size() == 0) return ConstIterator(const_cast<Var*>(this), true);
|
||||
|
||||
return ConstIterator(const_cast<Var*>(this), false);
|
||||
}
|
||||
@@ -749,7 +752,7 @@ inline Var::ConstIterator Var::end() const
|
||||
|
||||
inline Var::Iterator Var::begin()
|
||||
{
|
||||
if (isEmpty()) return Iterator(const_cast<Var*>(this), true);
|
||||
if (size() == 0) return Iterator(const_cast<Var*>(this), true);
|
||||
|
||||
return Iterator(const_cast<Var*>(this), false);
|
||||
}
|
||||
@@ -896,6 +899,13 @@ inline bool Var::isDateTime() const
|
||||
}
|
||||
|
||||
|
||||
inline bool Var::isUUID() const
|
||||
{
|
||||
VarHolder* pHolder = content();
|
||||
return pHolder ? pHolder->isUUID() : false;
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t Var::size() const
|
||||
{
|
||||
VarHolder* pHolder = content();
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "Poco/UnicodeConverter.h"
|
||||
#include "Poco/UTFString.h"
|
||||
#include "Poco/UTF8String.h"
|
||||
#include "Poco/UUID.h"
|
||||
#include "Poco/Any.h"
|
||||
#include "Poco/Exception.h"
|
||||
#include <vector>
|
||||
@@ -135,47 +136,51 @@ public:
|
||||
/// (typeid) for the stored content.
|
||||
|
||||
virtual void convert(Int8& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(Int16& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(Int32& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(Int64& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(UInt8& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(UInt16& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(UInt32& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(UInt64& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(DateTime& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(LocalDateTime& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(Timestamp& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(UUID& val) const;
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
@@ -189,96 +194,100 @@ public:
|
||||
#else
|
||||
|
||||
virtual void convert(long long& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to suport the conversion.
|
||||
|
||||
virtual void convert(unsigned long long & val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to suport the conversion.
|
||||
|
||||
#endif
|
||||
|
||||
virtual void convert(bool& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(float& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(double& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(char& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(std::string& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual void convert(Poco::UTF16String& val) const;
|
||||
/// Throws BadCastException. Must be overriden in a type
|
||||
/// Throws BadCastException. Must be overridden in a type
|
||||
/// specialization in order to support the conversion.
|
||||
|
||||
virtual bool isArray() const;
|
||||
/// Returns true.
|
||||
|
||||
virtual bool isVector() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isList() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isDeque() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isStruct() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isOrdered() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isInteger() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isSigned() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isNumeric() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isBoolean() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isString() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isDate() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isTime() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isDateTime() const;
|
||||
/// Returns false. Must be properly overriden in a type
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual bool isUUID() const;
|
||||
/// Returns false. Must be properly overridden in a type
|
||||
/// specialization in order to support the diagnostic.
|
||||
|
||||
virtual std::size_t size() const;
|
||||
/// Returns 1 iff Var is not empty or this function overriden.
|
||||
/// Returns 1 iff Var is not empty or this function overridden.
|
||||
|
||||
protected:
|
||||
VarHolder();
|
||||
@@ -519,8 +528,16 @@ inline void VarHolder::convert(Timestamp& /*val*/) const
|
||||
throw BadCastException("Can not convert to Timestamp");
|
||||
}
|
||||
|
||||
|
||||
inline void VarHolder::convert(UUID& /*val*/) const
|
||||
{
|
||||
throw BadCastException("Can not convert to UUID");
|
||||
}
|
||||
|
||||
|
||||
#ifndef POCO_INT64_IS_LONG
|
||||
|
||||
|
||||
inline void VarHolder::convert(long& val) const
|
||||
{
|
||||
Int32 tmp;
|
||||
@@ -536,8 +553,10 @@ inline void VarHolder::convert(unsigned long& val) const
|
||||
val = tmp;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
||||
inline void VarHolder::convert(long long& /*val*/) const
|
||||
{
|
||||
throw BadCastException("Can not convert to long long");
|
||||
@@ -549,8 +568,10 @@ inline void VarHolder::convert(unsigned long long& /*val*/) const
|
||||
throw BadCastException("Can not convert to unsigned long long");
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
inline void VarHolder::convert(bool& /*val*/) const
|
||||
{
|
||||
throw BadCastException("Can not convert to bool");
|
||||
@@ -671,6 +692,12 @@ inline bool VarHolder::isDateTime() const
|
||||
}
|
||||
|
||||
|
||||
inline bool VarHolder::isUUID() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
inline std::size_t VarHolder::size() const
|
||||
{
|
||||
return 1u;
|
||||
@@ -1026,7 +1053,6 @@ public:
|
||||
return std::numeric_limits<Int16>::is_specialized;
|
||||
}
|
||||
|
||||
|
||||
bool isString() const
|
||||
{
|
||||
return false;
|
||||
@@ -2750,6 +2776,11 @@ public:
|
||||
ts = tmp.timestamp();
|
||||
}
|
||||
|
||||
void convert(UUID& uuid) const
|
||||
{
|
||||
uuid.parse(_val);
|
||||
}
|
||||
|
||||
VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
|
||||
{
|
||||
return cloneHolder(pVarHolder, _val);
|
||||
@@ -3917,6 +3948,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isUUID() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
VarHolderImpl();
|
||||
VarHolderImpl(const VarHolderImpl&);
|
||||
@@ -4047,6 +4083,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isUUID() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
VarHolderImpl();
|
||||
VarHolderImpl(const VarHolderImpl&);
|
||||
@@ -4177,6 +4218,11 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isUUID() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
VarHolderImpl();
|
||||
VarHolderImpl(const VarHolderImpl&);
|
||||
@@ -4186,6 +4232,102 @@ private:
|
||||
};
|
||||
|
||||
|
||||
template <>
|
||||
class VarHolderImpl<UUID>: public VarHolder
|
||||
{
|
||||
public:
|
||||
VarHolderImpl(const UUID& val): _val(val)
|
||||
{
|
||||
}
|
||||
|
||||
~VarHolderImpl()
|
||||
{
|
||||
}
|
||||
|
||||
const std::type_info& type() const
|
||||
{
|
||||
return typeid(UUID);
|
||||
}
|
||||
|
||||
void convert(std::string& val) const
|
||||
{
|
||||
val = _val.toString();
|
||||
}
|
||||
|
||||
VarHolder* clone(Placeholder<VarHolder>* pVarHolder = 0) const
|
||||
{
|
||||
return cloneHolder(pVarHolder, _val);
|
||||
}
|
||||
|
||||
const UUID& value() const
|
||||
{
|
||||
return _val;
|
||||
}
|
||||
|
||||
bool isArray() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isStruct() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isInteger() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isSigned() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isNumeric() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isBoolean() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isString() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isDate() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isTime() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isDateTime() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isUUID() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
VarHolderImpl();
|
||||
VarHolderImpl(const VarHolderImpl&);
|
||||
VarHolderImpl& operator = (const VarHolderImpl&);
|
||||
|
||||
Poco::UUID _val;
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<Var> Vector;
|
||||
typedef std::deque<Var> Deque;
|
||||
typedef std::list<Var> List;
|
||||
|
||||
Reference in New Issue
Block a user