aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json/writer
diff options
context:
space:
mode:
authorluckybug <luckybug@yandex-team.ru>2022-02-10 16:50:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:27 +0300
commitb455da0978714a8b8dd026fc564b36dea5948f79 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/json/writer
parenta6d369648d0e4e2d446acfd469aced762d3c0492 (diff)
downloadydb-b455da0978714a8b8dd026fc564b36dea5948f79.tar.gz
Restoring authorship annotation for <luckybug@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/json/writer')
-rw-r--r--library/cpp/json/writer/json_value.cpp128
-rw-r--r--library/cpp/json/writer/json_value.h6
2 files changed, 67 insertions, 67 deletions
diff --git a/library/cpp/json/writer/json_value.cpp b/library/cpp/json/writer/json_value.cpp
index 7fd7344489..c61e8d1dc4 100644
--- a/library/cpp/json/writer/json_value.cpp
+++ b/library/cpp/json/writer/json_value.cpp
@@ -11,8 +11,8 @@
#include <util/string/type.h>
#include <util/string/vector.h>
#include <util/system/yassert.h>
-#include <util/ysaveload.h>
-#include <util/generic/bt_exception.h>
+#include <util/ysaveload.h>
+#include <util/generic/bt_exception.h>
static bool
AreJsonMapsEqual(const NJson::TJsonValue& lhs, const NJson::TJsonValue& rhs) {
@@ -989,68 +989,68 @@ namespace NJson {
tmp.SwapWithUndefined(rhs);
}
- void TJsonValue::Save(IOutputStream* s) const {
- ::Save(s, static_cast<ui8>(Type));
- switch (Type) {
- case JSON_UNDEFINED:break;
- case JSON_NULL:break;
- case JSON_BOOLEAN:
- ::Save(s, Value.Boolean);
- break;
- case JSON_INTEGER:
- ::Save(s, Value.Integer);
- break;
- case JSON_UINTEGER:
- ::Save(s, Value.UInteger);
- break;
- case JSON_DOUBLE:
- ::Save(s, Value.Double);
- break;
- case JSON_STRING:
- ::Save(s, Value.String);
- break;
- case JSON_MAP:
- ::Save(s, *Value.Map);
- break;
- case JSON_ARRAY:
- ::Save(s, *Value.Array);
- break;
- }
- }
-
- void TJsonValue::Load(IInputStream* s) {
- {
- ui8 loadedType = {};
- ::Load(s, loadedType);
- SetType(static_cast<EJsonValueType>(loadedType));
- }
- switch (Type) {
- case JSON_UNDEFINED:break;
- case JSON_NULL:break;
- case JSON_BOOLEAN:
- ::Load(s, Value.Boolean);
- break;
- case JSON_INTEGER:
- ::Load(s, Value.Integer);
- break;
- case JSON_UINTEGER:
- ::Load(s, Value.UInteger);
- break;
- case JSON_DOUBLE:
- ::Load(s, Value.Double);
- break;
- case JSON_STRING:
- ::Load(s, Value.String);
- break;
- case JSON_MAP:
- ::Load(s, *Value.Map);
- break;
- case JSON_ARRAY:
- ::Load(s, *Value.Array);
- break;
- }
- }
-
+ void TJsonValue::Save(IOutputStream* s) const {
+ ::Save(s, static_cast<ui8>(Type));
+ switch (Type) {
+ case JSON_UNDEFINED:break;
+ case JSON_NULL:break;
+ case JSON_BOOLEAN:
+ ::Save(s, Value.Boolean);
+ break;
+ case JSON_INTEGER:
+ ::Save(s, Value.Integer);
+ break;
+ case JSON_UINTEGER:
+ ::Save(s, Value.UInteger);
+ break;
+ case JSON_DOUBLE:
+ ::Save(s, Value.Double);
+ break;
+ case JSON_STRING:
+ ::Save(s, Value.String);
+ break;
+ case JSON_MAP:
+ ::Save(s, *Value.Map);
+ break;
+ case JSON_ARRAY:
+ ::Save(s, *Value.Array);
+ break;
+ }
+ }
+
+ void TJsonValue::Load(IInputStream* s) {
+ {
+ ui8 loadedType = {};
+ ::Load(s, loadedType);
+ SetType(static_cast<EJsonValueType>(loadedType));
+ }
+ switch (Type) {
+ case JSON_UNDEFINED:break;
+ case JSON_NULL:break;
+ case JSON_BOOLEAN:
+ ::Load(s, Value.Boolean);
+ break;
+ case JSON_INTEGER:
+ ::Load(s, Value.Integer);
+ break;
+ case JSON_UINTEGER:
+ ::Load(s, Value.UInteger);
+ break;
+ case JSON_DOUBLE:
+ ::Load(s, Value.Double);
+ break;
+ case JSON_STRING:
+ ::Load(s, Value.String);
+ break;
+ case JSON_MAP:
+ ::Load(s, *Value.Map);
+ break;
+ case JSON_ARRAY:
+ ::Load(s, *Value.Array);
+ break;
+ }
+ }
+
//****************************************************************
bool GetMapPointer(const TJsonValue& jv, const size_t index, const TJsonValue::TMapType** value) {
diff --git a/library/cpp/json/writer/json_value.h b/library/cpp/json/writer/json_value.h
index 1ce89a9370..3f0f50bc4c 100644
--- a/library/cpp/json/writer/json_value.h
+++ b/library/cpp/json/writer/json_value.h
@@ -186,11 +186,11 @@ namespace NJson {
void Swap(TJsonValue& rhs) noexcept;
// save using util/ysaveload.h serialization (not to JSON stream)
- void Save(IOutputStream* s) const;
+ void Save(IOutputStream* s) const;
// load using util/ysaveload.h serialization (not as JSON stream)
- void Load(IInputStream* s);
-
+ void Load(IInputStream* s);
+
static const TJsonValue UNDEFINED;
private: