diff --git a/Foundation/testsuite/src/StringTest.cpp b/Foundation/testsuite/src/StringTest.cpp index 82466fc7c..265c12ffb 100644 --- a/Foundation/testsuite/src/StringTest.cpp +++ b/Foundation/testsuite/src/StringTest.cpp @@ -22,6 +22,7 @@ #include #include #include +#include using Poco::trimLeft; diff --git a/JSON/include/Poco/JSON/Object.h b/JSON/include/Poco/JSON/Object.h index f05141159..9c3934dbe 100644 --- a/JSON/include/Poco/JSON/Object.h +++ b/JSON/include/Poco/JSON/Object.h @@ -38,13 +38,8 @@ namespace JSON { class JSON_API Object -<<<<<<< HEAD - /// Represents a JSON object. Object provides a representation - /// based on shared pointers and optimized for performance. It is possible to -======= /// Represents a JSON object. Object provides a representation based on /// shared pointers and optimized for performance. It is possible to ->>>>>>> df5968ce1... Json unicode escape && preserveOrder keys sync (#2145) /// convert Object to DynamicStruct. Conversion requires copying and therefore /// has performance penalty; the benefit is in improved syntax, eg: /// @@ -75,10 +70,6 @@ public: explicit Object(int options = 0); /// Creates an empty Object. /// -<<<<<<< HEAD - /// If preserveInsertionOrder, object will preserve the items insertion - /// order. Otherwise, items will be sorted by keys. -======= /// If JSON_PRESERVE_KEY_ORDER is specified, the object will /// preserve the items insertion order. Otherwise, items will be /// sorted by keys. @@ -86,7 +77,6 @@ public: /// If JSON_ESCAPE_UNICODE is specified, when the object is /// stringified, all unicode characters will be escaped in the /// resulting string. ->>>>>>> df5968ce1... Json unicode escape && preserveOrder keys sync (#2145) Object(const Object& copy); /// Creates an Object by copying another one. @@ -110,18 +100,8 @@ public: Object &operator =(const Object &other); // Assignment operator -<<<<<<< HEAD - Iterator begin() - { - return _values.begin(); - } -======= - Object &operator =(Object &&other); - // Move asignment operator - void setEscapeUnicode(bool escape = true); /// Sets the flag for escaping unicode. ->>>>>>> df5968ce1... Json unicode escape && preserveOrder keys sync (#2145) bool getEscapeUnicode() const; /// Returns the flag for escaping unicode. diff --git a/JSON/src/Array.cpp b/JSON/src/Array.cpp index c23d8fe22..710d0259c 100644 --- a/JSON/src/Array.cpp +++ b/JSON/src/Array.cpp @@ -26,7 +26,7 @@ namespace JSON { Array::Array(int options): _modified(false), - _escapeUnicode(options & Poco::JSON_ESCAPE_UNICODE) + _escapeUnicode((options & Poco::JSON_ESCAPE_UNICODE) != 0) { } diff --git a/JSON/src/Object.cpp b/JSON/src/Object.cpp index 3882cf0dc..5a376509f 100644 --- a/JSON/src/Object.cpp +++ b/JSON/src/Object.cpp @@ -26,8 +26,8 @@ namespace JSON { Object::Object(int options): - _preserveInsOrder(options & Poco::JSON_PRESERVE_KEY_ORDER), - _escapeUnicode(options & Poco::JSON_ESCAPE_UNICODE), + _preserveInsOrder((options & Poco::JSON_PRESERVE_KEY_ORDER) != 0), + _escapeUnicode((options & Poco::JSON_ESCAPE_UNICODE) != 0), _modified(false) { } @@ -62,17 +62,13 @@ Object &Object::operator= (Object &&other) { if (&other != this) { -<<<<<<< HEAD - _values = std::move(other._values); - _keys = std::move(other._keys); -======= _values = other._values; ->>>>>>> df5968ce1... Json unicode escape && preserveOrder keys sync (#2145) _preserveInsOrder = other._preserveInsOrder; syncKeys(other._keys); _escapeUnicode = other._escapeUnicode; _pStruct = !other._modified ? other._pStruct : 0; _modified = other._modified; + other.clear(); } return *this; } @@ -96,7 +92,6 @@ Object &Object::operator= (const Object &other) _escapeUnicode = other._escapeUnicode; _pStruct = !other._modified ? other._pStruct : 0; _modified = other._modified; - other.clear(); } return *this; } diff --git a/JSON/testsuite/src/JSONTest.cpp b/JSON/testsuite/src/JSONTest.cpp index d8d5cfac9..069e4b748 100644 --- a/JSON/testsuite/src/JSONTest.cpp +++ b/JSON/testsuite/src/JSONTest.cpp @@ -2073,6 +2073,7 @@ void JSONTest::testCopy() void JSONTest::testMove() { +#ifdef POCO_ENABLE_CPP11 Object obj1(Poco::JSON_PRESERVE_KEY_ORDER); obj1.set("foo", 0); obj1.set("bar", 0); @@ -2132,6 +2133,7 @@ void JSONTest::testMove() assert (nl[0] == "foo"); assert (nl[1] == "bar"); assert (nl[2] == "baz"); +#endif // POCO_ENABLE_CPP11 }