diff options
author | monster <monster@yandex-team.ru> | 2022-02-10 16:47:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:19 +0300 |
commit | b23c1d7a8015c2006a148fd93b84cdeb0aee17a3 (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/yson/node/node_io.cpp | |
parent | dd76ae1f6213d065375ab296699f764faafbe5bd (diff) | |
download | ydb-b23c1d7a8015c2006a148fd93b84cdeb0aee17a3.tar.gz |
Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson/node/node_io.cpp')
-rw-r--r-- | library/cpp/yson/node/node_io.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/library/cpp/yson/node/node_io.cpp b/library/cpp/yson/node/node_io.cpp index ea53e4d8b7..294a7f7217 100644 --- a/library/cpp/yson/node/node_io.cpp +++ b/library/cpp/yson/node/node_io.cpp @@ -1,8 +1,8 @@ #include "node_io.h" - -#include "node_builder.h" -#include "node_visitor.h" - + +#include "node_builder.h" +#include "node_visitor.h" + #include <library/cpp/yson/json/json_writer.h> #include <library/cpp/yson/parser.h> #include <library/cpp/yson/writer.h> @@ -11,13 +11,13 @@ #include <library/cpp/json/json_reader.h> #include <library/cpp/json/json_value.h> -#include <util/stream/input.h> -#include <util/stream/output.h> -#include <util/stream/str.h> +#include <util/stream/input.h> +#include <util/stream/output.h> +#include <util/stream/str.h> #include <util/stream/mem.h> - -namespace NYT { - + +namespace NYT { + static void WalkJsonTree(const NJson::TJsonValue& jsonValue, NJson::TJsonCallbacks* callbacks) { using namespace NJson; @@ -68,20 +68,20 @@ static void WalkJsonTree(const NJson::TJsonValue& jsonValue, NJson::TJsonCallbac static TNode CreateEmptyNodeByType(::NYson::EYsonType type) { - TNode result; - switch (type) { + TNode result; + switch (type) { case ::NYson::EYsonType::ListFragment: - result = TNode::CreateList(); - break; + result = TNode::CreateList(); + break; case ::NYson::EYsonType::MapFragment: - result = TNode::CreateMap(); - break; - default: - break; - } + result = TNode::CreateMap(); + break; + default: + break; + } return result; } - + TNode NodeFromYsonString(const TStringBuf input, ::NYson::EYsonType type) { TMemoryInput stream(input); @@ -106,19 +106,19 @@ TNode NodeFromYsonStream(IInputStream* input, ::NYson::EYsonType type) { TNode result = CreateEmptyNodeByType(type); - TNodeBuilder builder(&result); + TNodeBuilder builder(&result); ::NYson::TYsonParser parser(&builder, input, type); - parser.Parse(); - return result; -} - + parser.Parse(); + return result; +} + void NodeToYsonStream(const TNode& node, IOutputStream* output, NYson::EYsonFormat format) -{ +{ ::NYson::TYsonWriter writer(output, format); - TNodeVisitor visitor(&writer); - visitor.Visit(node); -} - + TNodeVisitor visitor(&writer); + visitor.Visit(node); +} + void NodeToCanonicalYsonStream(const TNode& node, IOutputStream* output, NYson::EYsonFormat format) { ::NYson::TYsonWriter writer(output, format); @@ -149,6 +149,6 @@ TNode NodeFromJsonValue(const NJson::TJsonValue& input) return result; } -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT |