aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json/writer/json_value.cpp
diff options
context:
space:
mode:
authortrofimenkov <trofimenkov@yandex-team.ru>2022-02-10 16:49:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:30 +0300
commit30cebc2cfa79af3b577760a113e203a79450e6b6 (patch)
tree49327bf3c28fab534b04b312a39179e70f7c2763 /library/cpp/json/writer/json_value.cpp
parenta2d2743094c8d255cda4011b317235874db4d01c (diff)
downloadydb-30cebc2cfa79af3b577760a113e203a79450e6b6.tar.gz
Restoring authorship annotation for <trofimenkov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json/writer/json_value.cpp')
-rw-r--r--library/cpp/json/writer/json_value.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/library/cpp/json/writer/json_value.cpp b/library/cpp/json/writer/json_value.cpp
index c61e8d1dc4..59dda03fe7 100644
--- a/library/cpp/json/writer/json_value.cpp
+++ b/library/cpp/json/writer/json_value.cpp
@@ -427,38 +427,38 @@ namespace NJson {
bool TJsonValue::GetBooleanSafe() const {
if (Type != JSON_BOOLEAN)
ythrow TJsonException() << "Not a boolean";
-
+
return Value.Boolean;
}
-
+
long long TJsonValue::GetIntegerSafe() const {
if (!IsInteger())
ythrow TJsonException() << "Not an integer";
-
+
return GetInteger();
}
-
+
unsigned long long TJsonValue::GetUIntegerSafe() const {
if (!IsUInteger())
ythrow TJsonException() << "Not an unsigned integer";
-
+
return GetUInteger();
}
-
+
double TJsonValue::GetDoubleSafe() const {
if (!IsDouble())
ythrow TJsonException() << "Not a double";
-
+
return GetDouble();
}
-
+
const TString& TJsonValue::GetStringSafe() const {
if (Type != JSON_STRING)
ythrow TJsonException() << "Not a string";
-
+
return Value.String;
}
-
+
bool TJsonValue::GetBooleanSafe(const bool defaultValue) const {
if (Type == JSON_UNDEFINED)
return defaultValue;
@@ -497,10 +497,10 @@ namespace NJson {
const TJsonValue::TMapType& TJsonValue::GetMapSafe() const {
if (Type != JSON_MAP)
ythrow TJsonException() << "Not a map";
-
+
return *Value.Map;
}
-
+
TJsonValue::TMapType& TJsonValue::GetMapSafe() {
return const_cast<TJsonValue::TMapType&>(const_cast<const TJsonValue*>(this)->GetMapSafe());
}
@@ -508,10 +508,10 @@ namespace NJson {
const TJsonValue::TArray& TJsonValue::GetArraySafe() const {
if (Type != JSON_ARRAY)
ythrow TJsonException() << "Not an array";
-
+
return *Value.Array;
}
-
+
TJsonValue::TArray& TJsonValue::GetArraySafe() {
return const_cast<TJsonValue::TArray&>(const_cast<const TJsonValue*>(this)->GetArraySafe());
}