back-port JSON and accompanying Foundation portions (JSONString, Dynamic::Var etc)

This commit is contained in:
Alex Fabijanic
2017-09-25 15:15:05 -05:00
parent 741fead666
commit 6efab2cd58
103 changed files with 22184 additions and 29859 deletions

View File

@@ -71,6 +71,19 @@ public:
Array(const Array& copy);
/// Creates an Array by copying another one.
#ifdef POCO_ENABLE_CPP11
Array(Array&& other);
/// Move constructor
Array& operator=(Array&& other);
/// Move assignment operator.
#endif // POCO_ENABLE_CPP11
Array& operator=(const Array& other);
/// Assignment operator.
virtual ~Array();
/// Destroys the Array.
@@ -165,6 +178,7 @@ public:
/// Removes the element on the given index.
operator const Poco::Dynamic::Array& () const;
/// Conversion operator to Dynamic::Array.
static Poco::Dynamic::Array makeArray(const JSON::Array::Ptr& arr);
/// Utility function for creation of array.
@@ -173,10 +187,13 @@ public:
/// Clears the contents of the array.
private:
void resetDynArray() const;
typedef SharedPtr<Poco::Dynamic::Array> ArrayPtr;
ValueVec _values;
mutable ArrayPtr _pArray;
mutable bool _modified;
};
@@ -224,6 +241,7 @@ inline bool Array::isArray(ConstIterator& it) const
inline void Array::add(const Dynamic::Var& value)
{
_values.push_back(value);
_modified = true;
}
@@ -231,6 +249,7 @@ inline void Array::set(unsigned int index, const Dynamic::Var& value)
{
if (index >= _values.size()) _values.resize(index + 1);
_values[index] = value;
_modified = true;
}
@@ -356,11 +375,6 @@ public:
return _val;
}
bool isArray() const
{
return false;
}
bool isInteger() const
{
return false;
@@ -495,11 +509,6 @@ public:
return _val;
}
bool isArray() const
{
return false;
}
bool isInteger() const
{
return false;