diff options
author | Ilnur Khuziev <ilnur.khuziev@yandex.ru> | 2022-02-10 16:46:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:13 +0300 |
commit | 736dcd8ca259457a136f2f9f9168c44643914323 (patch) | |
tree | ddd46a036d68bfa83aa11b892f31243ea6b068a1 /library/cpp/yson | |
parent | 9bf2fa2b060c9881d3135c2208c624a1dd546ecc (diff) | |
download | ydb-736dcd8ca259457a136f2f9f9168c44643914323.tar.gz |
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson')
-rw-r--r-- | library/cpp/yson/json/json_writer.cpp | 30 | ||||
-rw-r--r-- | library/cpp/yson/json/json_writer.h | 12 | ||||
-rw-r--r-- | library/cpp/yson/node/node.cpp | 4 | ||||
-rw-r--r-- | library/cpp/yson/node/node.h | 26 | ||||
-rw-r--r-- | library/cpp/yson/node/node_io.cpp | 6 | ||||
-rw-r--r-- | library/cpp/yson/node/node_ut.cpp | 2 |
6 files changed, 40 insertions, 40 deletions
diff --git a/library/cpp/yson/json/json_writer.cpp b/library/cpp/yson/json/json_writer.cpp index 87481256ec..f062683ede 100644 --- a/library/cpp/yson/json/json_writer.cpp +++ b/library/cpp/yson/json/json_writer.cpp @@ -17,21 +17,21 @@ namespace NYT { EJsonFormat format, EJsonAttributesMode attributesMode, ESerializedBoolFormat booleanFormat) - : TJsonWriter( - output, - NJson::TJsonWriterConfig{}.SetFormatOutput(format == JF_PRETTY), - type, - attributesMode, - booleanFormat - ) - {} - - TJsonWriter::TJsonWriter( - IOutputStream* output, - NJson::TJsonWriterConfig config, + : TJsonWriter( + output, + NJson::TJsonWriterConfig{}.SetFormatOutput(format == JF_PRETTY), + type, + attributesMode, + booleanFormat + ) + {} + + TJsonWriter::TJsonWriter( + IOutputStream* output, + NJson::TJsonWriterConfig config, ::NYson::EYsonType type, - EJsonAttributesMode attributesMode, - ESerializedBoolFormat booleanFormat) + EJsonAttributesMode attributesMode, + ESerializedBoolFormat booleanFormat) : Output(output) , Type(type) , AttributesMode(attributesMode) @@ -44,7 +44,7 @@ namespace NYT { UnderlyingJsonWriter.Reset(new NJson::TJsonWriter( output, - config)); + config)); JsonWriter = UnderlyingJsonWriter.Get(); HasAttributes = false; InAttributesBalance = 0; diff --git a/library/cpp/yson/json/json_writer.h b/library/cpp/yson/json/json_writer.h index d84ac0de53..8cbb02c51c 100644 --- a/library/cpp/yson/json/json_writer.h +++ b/library/cpp/yson/json/json_writer.h @@ -36,13 +36,13 @@ namespace NYT { EJsonAttributesMode attributesMode = JAM_ON_DEMAND, ESerializedBoolFormat booleanFormat = SBF_STRING); - TJsonWriter( - IOutputStream* output, - NJson::TJsonWriterConfig config, + TJsonWriter( + IOutputStream* output, + NJson::TJsonWriterConfig config, ::NYson::EYsonType type = ::NYson::EYsonType::Node, - EJsonAttributesMode attributesMode = JAM_ON_DEMAND, - ESerializedBoolFormat booleanFormat = SBF_STRING); - + EJsonAttributesMode attributesMode = JAM_ON_DEMAND, + ESerializedBoolFormat booleanFormat = SBF_STRING); + void Flush(); void OnStringScalar(TStringBuf value) override; diff --git a/library/cpp/yson/node/node.cpp b/library/cpp/yson/node/node.cpp index b39e070718..5f0a956096 100644 --- a/library/cpp/yson/node/node.cpp +++ b/library/cpp/yson/node/node.cpp @@ -123,7 +123,7 @@ TNode::TNode(int i) TNode::TNode(unsigned int ui) : Value_(static_cast<ui64>(ui)) { } - + TNode::TNode(long i) : Value_(static_cast<i64>(i)) { } @@ -849,7 +849,7 @@ void TNode::CreateAttributes() Attributes_ = MakeHolder<TNode>(); Attributes_->Value_ = TMapType(); } - + void TNode::Save(IOutputStream* out) const { NodeToYsonStream(*this, out, NYson::EYsonFormat::Binary); diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index 5f90f95df0..c06d8e6070 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -79,21 +79,21 @@ public: TNode(TString s); TNode(int i); - //this case made speccially for prevent mess cast of EType into TNode through TNode(int) constructor + //this case made speccially for prevent mess cast of EType into TNode through TNode(int) constructor //usual case of error SomeNode == TNode::Undefined <-- SomeNode indeed will be compared with TNode(0) without this method //correct way is SomeNode.GetType() == TNode::Undefined - template<class T = EType> - Y_FORCE_INLINE TNode(EType) - { - static_assert(!std::is_same<T, EType>::value, "looks like a mistake, may be you forget .GetType()"); - } - - //this case made speccially for prevent mess cast of T* into TNode through implicit bool ctr - template<class T = int> - Y_FORCE_INLINE TNode(const T*) : TNode() { - static_assert(!std::is_same<T,T>::value, "looks like a mistake, and pointer have converted to bool"); - } - + template<class T = EType> + Y_FORCE_INLINE TNode(EType) + { + static_assert(!std::is_same<T, EType>::value, "looks like a mistake, may be you forget .GetType()"); + } + + //this case made speccially for prevent mess cast of T* into TNode through implicit bool ctr + template<class T = int> + Y_FORCE_INLINE TNode(const T*) : TNode() { + static_assert(!std::is_same<T,T>::value, "looks like a mistake, and pointer have converted to bool"); + } + TNode(unsigned int ui); TNode(long i); TNode(unsigned long ui); diff --git a/library/cpp/yson/node/node_io.cpp b/library/cpp/yson/node/node_io.cpp index 294a7f7217..443ba2cf1d 100644 --- a/library/cpp/yson/node/node_io.cpp +++ b/library/cpp/yson/node/node_io.cpp @@ -134,9 +134,9 @@ TNode NodeFromJsonString(const TStringBuf input) TNodeBuilder builder(&result); TYson2JsonCallbacksAdapter callbacks(&builder, /*throwException*/ true); - NJson::TJsonReaderConfig config; - config.DontValidateUtf8 = true; - NJson::ReadJson(&stream, &config, &callbacks); + NJson::TJsonReaderConfig config; + config.DontValidateUtf8 = true; + NJson::ReadJson(&stream, &config, &callbacks); return result; } diff --git a/library/cpp/yson/node/node_ut.cpp b/library/cpp/yson/node/node_ut.cpp index 448e99f575..de9cf702ea 100644 --- a/library/cpp/yson/node/node_ut.cpp +++ b/library/cpp/yson/node/node_ut.cpp @@ -1,7 +1,7 @@ #include "node.h" #include "node_io.h" -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> #include <util/ysaveload.h> |