aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:45:01 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:01 +0300
commit2d37894b1b037cf24231090eda8589bbb44fb6fc (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/json
parent718c552901d703c502ccbefdfc3c9028d608b947 (diff)
downloadydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
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.cpp94
1 files changed, 47 insertions, 47 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 3a4b34fa38..9b785d1995 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
@@ -1,14 +1,14 @@
-/**
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
- * SPDX-License-Identifier: Apache-2.0.
- */
+/**
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ * SPDX-License-Identifier: Apache-2.0.
+ */
#include <aws/core/utils/json/JsonSerializer.h>
#include <iterator>
#include <algorithm>
#include <aws/core/utils/memory/stl/AWSStringStream.h>
-#include <aws/core/utils/StringUtils.h>
+#include <aws/core/utils/StringUtils.h>
using namespace Aws::Utils;
using namespace Aws::Utils::Json;
@@ -186,26 +186,26 @@ JsonValue& JsonValue::AsInteger(int value)
JsonValue& JsonValue::WithInt64(const char* key, long long value)
{
- if (!m_value)
- {
- m_value = cJSON_CreateObject();
- }
-
- const auto val = cJSON_CreateInt64(value);
- AddOrReplace(m_value, key, val);
- return *this;
+ if (!m_value)
+ {
+ m_value = cJSON_CreateObject();
+ }
+
+ const auto val = cJSON_CreateInt64(value);
+ AddOrReplace(m_value, key, val);
+ return *this;
}
JsonValue& JsonValue::WithInt64(const Aws::String& key, long long value)
{
- return WithInt64(key.c_str(), value);
+ return WithInt64(key.c_str(), value);
}
JsonValue& JsonValue::AsInt64(long long value)
{
- Destroy();
- m_value = cJSON_CreateInt64(value);
- return *this;
+ Destroy();
+ m_value = cJSON_CreateInt64(value);
+ return *this;
}
JsonValue& JsonValue::WithDouble(const char* key, double value)
@@ -449,30 +449,30 @@ int JsonView::AsInteger() const
int64_t JsonView::GetInt64(const Aws::String& key) const
{
- assert(m_value);
- auto item = cJSON_GetObjectItemCaseSensitive(m_value, key.c_str());
- assert(item);
- if (item->valuestring)
- {
- return Aws::Utils::StringUtils::ConvertToInt64(item->valuestring);
- }
- else
- {
- return static_cast<int64_t>(item->valuedouble);
- }
+ assert(m_value);
+ auto item = cJSON_GetObjectItemCaseSensitive(m_value, key.c_str());
+ assert(item);
+ if (item->valuestring)
+ {
+ return Aws::Utils::StringUtils::ConvertToInt64(item->valuestring);
+ }
+ else
+ {
+ return static_cast<int64_t>(item->valuedouble);
+ }
}
int64_t JsonView::AsInt64() const
{
assert(cJSON_IsNumber(m_value));
- if (m_value->valuestring)
- {
- return Aws::Utils::StringUtils::ConvertToInt64(m_value->valuestring);
- }
- else
- {
- return static_cast<int64_t>(m_value->valuedouble);
- }
+ if (m_value->valuestring)
+ {
+ return Aws::Utils::StringUtils::ConvertToInt64(m_value->valuestring);
+ }
+ else
+ {
+ return static_cast<int64_t>(m_value->valuedouble);
+ }
}
double JsonView::GetDouble(const Aws::String& key) const
@@ -498,7 +498,7 @@ JsonView JsonView::GetObject(const Aws::String& key) const
JsonView JsonView::AsObject() const
{
- assert(cJSON_IsObject(m_value) || cJSON_IsNull(m_value));
+ assert(cJSON_IsObject(m_value) || cJSON_IsNull(m_value));
return m_value;
}
@@ -592,11 +592,11 @@ bool JsonView::IsIntegerType() const
return false;
}
- if (m_value->valuestring)
- {
- Aws::String valueString = m_value->valuestring;
- return std::all_of(valueString.begin(), valueString.end(), [](unsigned char c){ return ::isdigit(c) || c == '+' || c == '-'; });
- }
+ if (m_value->valuestring)
+ {
+ Aws::String valueString = m_value->valuestring;
+ return std::all_of(valueString.begin(), valueString.end(), [](unsigned char c){ return ::isdigit(c) || c == '+' || c == '-'; });
+ }
return m_value->valuedouble == static_cast<long long>(m_value->valuedouble);
}
@@ -607,11 +607,11 @@ bool JsonView::IsFloatingPointType() const
return false;
}
- if (m_value->valuestring)
- {
- Aws::String valueString = m_value->valuestring;
- return std::any_of(valueString.begin(), valueString.end(), [](unsigned char c){ return !::isdigit(c) && c != '+' && c != '-'; });
- }
+ if (m_value->valuestring)
+ {
+ Aws::String valueString = m_value->valuestring;
+ return std::any_of(valueString.begin(), valueString.end(), [](unsigned char c){ return !::isdigit(c) && c != '+' && c != '-'; });
+ }
return m_value->valuedouble != static_cast<long long>(m_value->valuedouble);
}