diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/yson | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson')
-rw-r--r-- | library/cpp/yson/node/node.cpp | 70 | ||||
-rw-r--r-- | library/cpp/yson/node/node.h | 20 | ||||
-rw-r--r-- | library/cpp/yson/node/node_ut.cpp | 30 | ||||
-rw-r--r-- | library/cpp/yson/parser.cpp | 4 | ||||
-rw-r--r-- | library/cpp/yson/parser.h | 2 | ||||
-rw-r--r-- | library/cpp/yson/writer.h | 4 |
6 files changed, 65 insertions, 65 deletions
diff --git a/library/cpp/yson/node/node.cpp b/library/cpp/yson/node/node.cpp index b39e070718..c5933fa943 100644 --- a/library/cpp/yson/node/node.cpp +++ b/library/cpp/yson/node/node.cpp @@ -7,7 +7,7 @@ #include <util/generic/overloaded.h> namespace NYT { - + //////////////////////////////////////////////////////////////////////////////// bool TNode::TNull::operator==(const TNull&) const { @@ -346,51 +346,51 @@ TNode::TMapType& TNode::AsMap() return std::get<TMapType>(Value_); } -const TString& TNode::UncheckedAsString() const noexcept -{ +const TString& TNode::UncheckedAsString() const noexcept +{ return std::get<TString>(Value_); -} - -i64 TNode::UncheckedAsInt64() const noexcept -{ +} + +i64 TNode::UncheckedAsInt64() const noexcept +{ return std::get<i64>(Value_); -} - -ui64 TNode::UncheckedAsUint64() const noexcept -{ +} + +ui64 TNode::UncheckedAsUint64() const noexcept +{ return std::get<ui64>(Value_); -} - -double TNode::UncheckedAsDouble() const noexcept -{ +} + +double TNode::UncheckedAsDouble() const noexcept +{ return std::get<double>(Value_); -} - -bool TNode::UncheckedAsBool() const noexcept -{ +} + +bool TNode::UncheckedAsBool() const noexcept +{ return std::get<bool>(Value_); -} - +} + const TNode::TListType& TNode::UncheckedAsList() const noexcept -{ +{ return std::get<TListType>(Value_); -} - +} + const TNode::TMapType& TNode::UncheckedAsMap() const noexcept -{ +{ return std::get<TMapType>(Value_); -} - +} + TNode::TListType& TNode::UncheckedAsList() noexcept -{ +{ return std::get<TListType>(Value_); -} - +} + TNode::TMapType& TNode::UncheckedAsMap() noexcept -{ +{ return std::get<TMapType>(Value_); -} - +} + TNode TNode::CreateList() { TNode node; @@ -850,12 +850,12 @@ void TNode::CreateAttributes() Attributes_->Value_ = TMapType(); } -void TNode::Save(IOutputStream* out) const +void TNode::Save(IOutputStream* out) const { NodeToYsonStream(*this, out, NYson::EYsonFormat::Binary); } -void TNode::Load(IInputStream* in) +void TNode::Load(IInputStream* in) { Clear(); *this = NodeFromYsonStream(in, ::NYson::EYsonType::Node); diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index 5f90f95df0..971b5355be 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -12,8 +12,8 @@ #include <cmath> #include <variant> -class IInputStream; -class IOutputStream; +class IInputStream; +class IOutputStream; namespace NYT { @@ -149,16 +149,16 @@ public: TListType& AsList(); TMapType& AsMap(); - const TString& UncheckedAsString() const noexcept; - i64 UncheckedAsInt64() const noexcept; - ui64 UncheckedAsUint64() const noexcept; - double UncheckedAsDouble() const noexcept; - bool UncheckedAsBool() const noexcept; + const TString& UncheckedAsString() const noexcept; + i64 UncheckedAsInt64() const noexcept; + ui64 UncheckedAsUint64() const noexcept; + double UncheckedAsDouble() const noexcept; + bool UncheckedAsBool() const noexcept; const TListType& UncheckedAsList() const noexcept; const TMapType& UncheckedAsMap() const noexcept; TListType& UncheckedAsList() noexcept; TMapType& UncheckedAsMap() noexcept; - + // integer types cast // makes overflow checks template<typename T> @@ -264,8 +264,8 @@ public: // Serialize TNode using binary yson format. // Methods for ysaveload. - void Save(IOutputStream* output) const; - void Load(IInputStream* input); + void Save(IOutputStream* output) const; + void Load(IInputStream* input); private: void Move(TNode&& rhs); diff --git a/library/cpp/yson/node/node_ut.cpp b/library/cpp/yson/node/node_ut.cpp index 448e99f575..f6922f7d01 100644 --- a/library/cpp/yson/node/node_ut.cpp +++ b/library/cpp/yson/node/node_ut.cpp @@ -8,13 +8,13 @@ using namespace NYT; template<> -void Out<NYT::TNode>(IOutputStream& s, const NYT::TNode& node) +void Out<NYT::TNode>(IOutputStream& s, const NYT::TNode& node) { s << "TNode:" << NodeToYsonString(node); } -Y_UNIT_TEST_SUITE(YtNodeTest) { - Y_UNIT_TEST(TestConstsructors) { +Y_UNIT_TEST_SUITE(YtNodeTest) { + Y_UNIT_TEST(TestConstsructors) { TNode nodeEmpty; UNIT_ASSERT_EQUAL(nodeEmpty.GetType(), TNode::Undefined); @@ -82,7 +82,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_VALUES_EQUAL(mapNode.AsMap(), expectedMapValue); } - Y_UNIT_TEST(TestNodeMap) { + Y_UNIT_TEST(TestNodeMap) { TNode nodeMap = TNode()("foo", "bar")("bar", "baz"); UNIT_ASSERT(nodeMap.IsMap()); UNIT_ASSERT_EQUAL(nodeMap.GetType(), TNode::Map); @@ -113,7 +113,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_EQUAL(copyNode["rock!!!"]["Purple"], TNode("Deep")); } - Y_UNIT_TEST(TestNodeList) { + Y_UNIT_TEST(TestNodeList) { TNode nodeList = TNode().Add("foo").Add(42).Add(3.14); UNIT_ASSERT(nodeList.IsList()); UNIT_ASSERT_EQUAL(nodeList.GetType(), TNode::List); @@ -128,7 +128,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_EQUAL(copyNode[3][1], TNode("pwd")); } - Y_UNIT_TEST(TestInsertingMethodsFromTemporaryObjects) { + Y_UNIT_TEST(TestInsertingMethodsFromTemporaryObjects) { // check that .Add(...) doesn't return lvalue reference to temporary object { const TNode& nodeList = TNode().Add(0).Add("pass").Add(0); @@ -142,7 +142,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { } } - Y_UNIT_TEST(TestAttributes) { + Y_UNIT_TEST(TestAttributes) { TNode node = TNode()("lee", 42)("faa", 54); UNIT_ASSERT(!node.HasAttributes()); node.Attributes()("foo", true)("bar", false); @@ -185,7 +185,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { } } - Y_UNIT_TEST(TestEq) { + Y_UNIT_TEST(TestEq) { TNode nodeNoAttributes = TNode()("lee", 42)("faa", 54); TNode node = nodeNoAttributes; node.Attributes()("foo", true)("bar", false); @@ -260,7 +260,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { } } - Y_UNIT_TEST(TestSaveLoad) { + Y_UNIT_TEST(TestSaveLoad) { TNode node = TNode()("foo", "bar")("baz", 42); node.Attributes()["attr_name"] = "attr_value"; @@ -279,7 +279,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_VALUES_EQUAL(node, nodeCopy); } - Y_UNIT_TEST(TestIntCast) { + Y_UNIT_TEST(TestIntCast) { TNode node = 1ull << 31; UNIT_ASSERT(node.IsUint64()); UNIT_ASSERT_EXCEPTION(node.IntCast<i32>(), TNode::TTypeError); @@ -315,7 +315,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_EXCEPTION(node.IntCast<ui64>(), TNode::TTypeError); } - Y_UNIT_TEST(TestConvertToString) { + Y_UNIT_TEST(TestConvertToString) { UNIT_ASSERT_VALUES_EQUAL(TNode(5).ConvertTo<TString>(), "5"); UNIT_ASSERT_VALUES_EQUAL(TNode(123432423).ConvertTo<TString>(), "123432423"); UNIT_ASSERT_VALUES_EQUAL(TNode(123456789012345678ll).ConvertTo<TString>(), "123456789012345678"); @@ -326,7 +326,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_VALUES_EQUAL(TNode(5.3).ConvertTo<TString>(), "5.3"); } - Y_UNIT_TEST(TestConvertFromString) { + Y_UNIT_TEST(TestConvertFromString) { UNIT_ASSERT_VALUES_EQUAL(TNode("123456789012345678").ConvertTo<ui64>(), 123456789012345678ull); UNIT_ASSERT_VALUES_EQUAL(TNode("123456789012345678").ConvertTo<i64>(), 123456789012345678); UNIT_ASSERT_VALUES_EQUAL(TNode(ToString(1ull << 63)).ConvertTo<ui64>(), 1ull << 63); @@ -334,7 +334,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_VALUES_EQUAL(TNode("5.34").ConvertTo<double>(), 5.34); } - Y_UNIT_TEST(TestConvertDoubleInt) { + Y_UNIT_TEST(TestConvertDoubleInt) { UNIT_ASSERT_VALUES_EQUAL(TNode(5.3).ConvertTo<i8>(), 5); UNIT_ASSERT_VALUES_EQUAL(TNode(5.3).ConvertTo<ui8>(), 5); UNIT_ASSERT_VALUES_EQUAL(TNode(5.3).ConvertTo<i64>(), 5); @@ -372,7 +372,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_EXCEPTION(TNode(INFINITY).ConvertTo<i64>(), TNode::TTypeError); } - Y_UNIT_TEST(TestConvertToBool) { + Y_UNIT_TEST(TestConvertToBool) { UNIT_ASSERT_VALUES_EQUAL(TNode("true").ConvertTo<bool>(), true); UNIT_ASSERT_VALUES_EQUAL(TNode("TRUE").ConvertTo<bool>(), true); UNIT_ASSERT_VALUES_EQUAL(TNode("false").ConvertTo<bool>(), false); @@ -383,7 +383,7 @@ Y_UNIT_TEST_SUITE(YtNodeTest) { UNIT_ASSERT_EXCEPTION(TNode("").ConvertTo<bool>(), TFromStringException); } - Y_UNIT_TEST(TestCanonicalSerialization) { + Y_UNIT_TEST(TestCanonicalSerialization) { auto node = TNode() ("ca", "ca")("c", "c")("a", "a")("b", "b") ("bb", TNode() diff --git a/library/cpp/yson/parser.cpp b/library/cpp/yson/parser.cpp index 783f9b9047..99d2e55b9c 100644 --- a/library/cpp/yson/parser.cpp +++ b/library/cpp/yson/parser.cpp @@ -47,7 +47,7 @@ namespace NYson { TYsonParser::TYsonParser( NYT::NYson::IYsonConsumer* consumer, - IInputStream* stream, + IInputStream* stream, EYsonType type, bool enableLinePositionInfo, TMaybe<ui64> memoryLimit) @@ -160,7 +160,7 @@ namespace NYson { TYsonListParser::TYsonListParser( NYT::NYson::IYsonConsumer* consumer, - IInputStream* stream, + IInputStream* stream, bool enableLinePositionInfo, TMaybe<ui64> memoryLimit) : Impl(new TImpl(consumer, stream, enableLinePositionInfo, memoryLimit)) diff --git a/library/cpp/yson/parser.h b/library/cpp/yson/parser.h index dce35a8cd4..1cb6fa0919 100644 --- a/library/cpp/yson/parser.h +++ b/library/cpp/yson/parser.h @@ -5,7 +5,7 @@ #include <util/generic/maybe.h> #include <util/generic/ptr.h> -class IInputStream; +class IInputStream; namespace NYT::NYson { struct IYsonConsumer; diff --git a/library/cpp/yson/writer.h b/library/cpp/yson/writer.h index 40f5d7d501..a43cce58f3 100644 --- a/library/cpp/yson/writer.h +++ b/library/cpp/yson/writer.h @@ -6,8 +6,8 @@ #include <util/generic/noncopyable.h> -class IOutputStream; -class IZeroCopyInput; +class IOutputStream; +class IZeroCopyInput; namespace NYson { //////////////////////////////////////////////////////////////////////////////// |