diff options
author | nadya73 <nadya73@yandex-team.ru> | 2022-02-10 16:49:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:18 +0300 |
commit | b6e35c760e81fe851ac4da1abc08e6ec8e779c10 (patch) | |
tree | bffcb657a262b70deabd6a12cf65b823c9332150 /library/cpp/json/yson | |
parent | cb691264f012c552bac85a9fe352baa062cd81dd (diff) | |
download | ydb-b6e35c760e81fe851ac4da1abc08e6ec8e779c10.tar.gz |
Restoring authorship annotation for <nadya73@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/json/yson')
-rw-r--r-- | library/cpp/json/yson/json2yson.cpp | 10 | ||||
-rw-r--r-- | library/cpp/json/yson/json2yson.h | 12 |
2 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/json/yson/json2yson.cpp b/library/cpp/json/yson/json2yson.cpp index f72cb7a9ef..fefa8253a7 100644 --- a/library/cpp/json/yson/json2yson.cpp +++ b/library/cpp/json/yson/json2yson.cpp @@ -47,13 +47,13 @@ namespace NJson2Yson { } } - void SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue, NYson::TYsonWriter* ysonWriter) { + void SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue, NYson::TYsonWriter* ysonWriter) { NYT::TYson2JsonCallbacksAdapter adapter(ysonWriter); WriteJsonValue(inputValue, &adapter); } void SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue, IOutputStream* outputStream) { - NYson::TYsonWriter ysonWriter(outputStream, NYson::EYsonFormat::Binary, ::NYson::EYsonType::Node, false); + NYson::TYsonWriter ysonWriter(outputStream, NYson::EYsonFormat::Binary, ::NYson::EYsonType::Node, false); SerializeJsonValueAsYson(inputValue, &ysonWriter); } @@ -71,7 +71,7 @@ namespace NJson2Yson { bool DeserializeYsonAsJsonValue(IInputStream* inputStream, NJson::TJsonValue* outputValue, bool throwOnError) { NJson::TParserCallbacks parser(*outputValue); NJson2Yson::TJsonBuilder consumer(&parser); - NYson::TYsonParser ysonParser(&consumer, inputStream, ::NYson::EYsonType::Node); + NYson::TYsonParser ysonParser(&consumer, inputStream, ::NYson::EYsonType::Node); try { ysonParser.Parse(); } catch (...) { @@ -89,8 +89,8 @@ namespace NJson2Yson { } void ConvertYson2Json(IInputStream* inputStream, IOutputStream* outputStream) { - NYT::TJsonWriter writer(outputStream, ::NYson::EYsonType::Node, NYT::JF_TEXT, NYT::JAM_ON_DEMAND, NYT::SBF_BOOLEAN); - NYson::TYsonParser ysonParser(&writer, inputStream, ::NYson::EYsonType::Node); + NYT::TJsonWriter writer(outputStream, ::NYson::EYsonType::Node, NYT::JF_TEXT, NYT::JAM_ON_DEMAND, NYT::SBF_BOOLEAN); + NYson::TYsonParser ysonParser(&writer, inputStream, ::NYson::EYsonType::Node); ysonParser.Parse(); } diff --git a/library/cpp/json/yson/json2yson.h b/library/cpp/json/yson/json2yson.h index 758eb6d0cf..15ad98e8e7 100644 --- a/library/cpp/json/yson/json2yson.h +++ b/library/cpp/json/yson/json2yson.h @@ -5,14 +5,14 @@ #include <library/cpp/yson/writer.h> namespace NJson2Yson { - class TJsonBuilderImpl: public NYson::TYsonConsumerBase { + class TJsonBuilderImpl: public NYson::TYsonConsumerBase { public: TJsonBuilderImpl(NJson::TJsonCallbacks* parserCallbacks) : ParserCallbacks_(parserCallbacks) { } - void OnStringScalar(TStringBuf value) override { + void OnStringScalar(TStringBuf value) override { ParserCallbacks_->OnString(value); } @@ -51,7 +51,7 @@ namespace NJson2Yson { ParserCallbacks_->OnOpenMap(); } - void OnKeyedItem(TStringBuf key) override { + void OnKeyedItem(TStringBuf key) override { ParserCallbacks_->OnMapKey(key); } @@ -78,7 +78,7 @@ namespace NJson2Yson { { } - void OnStringScalar(TStringBuf value) override { + void OnStringScalar(TStringBuf value) override { if (AttributesDepth == 0) { TBase::OnStringScalar(value); } @@ -138,7 +138,7 @@ namespace NJson2Yson { } } - void OnKeyedItem(TStringBuf key) override { + void OnKeyedItem(TStringBuf key) override { if (AttributesDepth == 0) { TBase::OnKeyedItem(key); } @@ -172,7 +172,7 @@ namespace NJson2Yson { bool DeserializeYsonAsJsonValue(IInputStream* inputStream, NJson::TJsonValue* outputValue, bool throwOnError = false); bool DeserializeYsonAsJsonValue(TStringBuf str, NJson::TJsonValue* outputValue, bool throwOnError = false); - void SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue, NYson::TYsonWriter* ysonWriter); + void SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue, NYson::TYsonWriter* ysonWriter); void SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue, IOutputStream* outputStream); void SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue, TString& result); TString SerializeJsonValueAsYson(const NJson::TJsonValue& inputValue); |