aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json
diff options
context:
space:
mode:
authordakovalkov <dakovalkov@yandex-team.com>2023-12-03 13:33:55 +0300
committerdakovalkov <dakovalkov@yandex-team.com>2023-12-03 14:04:39 +0300
commit2a718325637e5302334b6d0a6430f63168f8dbb3 (patch)
tree64be81080b7df9ec1d86d053a0c394ae53fcf1fe /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json
parente0d94a470142d95c3007e9c5d80380994940664a (diff)
downloadydb-2a718325637e5302334b6d0a6430f63168f8dbb3.tar.gz
Update contrib/libs/aws-sdk-cpp to 1.11.37
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json')
-rw-r--r--contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp
index 9358d00c0a..ebfd5d4456 100644
--- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp
+++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json/JsonSerializer.cpp
@@ -9,6 +9,7 @@
#include <algorithm>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/Document.h>
using namespace Aws::Utils;
using namespace Aws::Utils::Json;
@@ -68,6 +69,13 @@ JsonValue::JsonValue(JsonValue&& value) :
value.m_value = nullptr;
}
+JsonValue::JsonValue(const Aws::Utils::DocumentView& value) :
+ m_value(cJSON_AS4CPP_Duplicate(value.m_json, true/*recurse*/)),
+ m_wasParseSuccessful(true),
+ m_errorMessage({})
+{
+}
+
void JsonValue::Destroy()
{
cJSON_AS4CPP_Delete(m_value);
@@ -106,6 +114,15 @@ JsonValue& JsonValue::operator=(JsonValue&& other)
return *this;
}
+JsonValue& JsonValue::operator=(const Aws::Utils::DocumentView& other)
+{
+ Destroy();
+ m_value = cJSON_AS4CPP_Duplicate(other.m_json, true /*recurse*/);
+ m_wasParseSuccessful = true;
+ m_errorMessage = {};
+ return *this;
+}
+
static void AddOrReplace(cJSON* root, const char* key, cJSON* value)
{
const auto existing = cJSON_AS4CPP_GetObjectItemCaseSensitive(root, key);