diff options
author | levysotsky <levysotsky@yandex-team.ru> | 2022-02-10 16:47:29 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:29 +0300 |
commit | 32b231c8474a1ade4bdf776ade6a20341691d9d7 (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/yson/node/serialize.cpp | |
parent | 57f874ffc2a75047c1c4fea7a9fc86cb0f56ed50 (diff) | |
download | ydb-32b231c8474a1ade4bdf776ade6a20341691d9d7.tar.gz |
Restoring authorship annotation for <levysotsky@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson/node/serialize.cpp')
-rw-r--r-- | library/cpp/yson/node/serialize.cpp | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/library/cpp/yson/node/serialize.cpp b/library/cpp/yson/node/serialize.cpp index f65c599186..aeb467622b 100644 --- a/library/cpp/yson/node/serialize.cpp +++ b/library/cpp/yson/node/serialize.cpp @@ -1,101 +1,101 @@ -#include "serialize.h" - +#include "serialize.h" + #include "node_visitor.h" - + #include <library/cpp/yson/consumer.h> - -namespace NYT { - -//////////////////////////////////////////////////////////////////////////////// - + +namespace NYT { + +//////////////////////////////////////////////////////////////////////////////// + void Serialize(const TString& value, NYson::IYsonConsumer* consumer) -{ - consumer->OnStringScalar(value); -} - +{ + consumer->OnStringScalar(value); +} + void Serialize(const TStringBuf& value, NYson::IYsonConsumer* consumer) -{ - consumer->OnStringScalar(value); -} - +{ + consumer->OnStringScalar(value); +} + void Serialize(const char* value, NYson::IYsonConsumer* consumer) -{ - consumer->OnStringScalar(value); -} - -void Deserialize(TString& value, const TNode& node) -{ - value = node.AsString(); -} - -#define SERIALIZE_SIGNED(type) \ +{ + consumer->OnStringScalar(value); +} + +void Deserialize(TString& value, const TNode& node) +{ + value = node.AsString(); +} + +#define SERIALIZE_SIGNED(type) \ void Serialize(type value, NYson::IYsonConsumer* consumer) \ -{ \ - consumer->OnInt64Scalar(static_cast<i64>(value)); \ -} - -#define SERIALIZE_UNSIGNED(type) \ +{ \ + consumer->OnInt64Scalar(static_cast<i64>(value)); \ +} + +#define SERIALIZE_UNSIGNED(type) \ void Serialize(type value, NYson::IYsonConsumer* consumer) \ -{ \ - consumer->OnUint64Scalar(static_cast<ui64>(value)); \ -} - -SERIALIZE_SIGNED(signed char); -SERIALIZE_SIGNED(short); -SERIALIZE_SIGNED(int); -SERIALIZE_SIGNED(long); -SERIALIZE_SIGNED(long long); - -SERIALIZE_UNSIGNED(unsigned char); -SERIALIZE_UNSIGNED(unsigned short); -SERIALIZE_UNSIGNED(unsigned int); -SERIALIZE_UNSIGNED(unsigned long); -SERIALIZE_UNSIGNED(unsigned long long); - -#undef SERIALIZE_SIGNED -#undef SERIALIZE_UNSIGNED - -void Deserialize(i64& value, const TNode& node) -{ - value = node.AsInt64(); -} - -void Deserialize(ui64& value, const TNode& node) -{ - value = node.AsUint64(); -} - +{ \ + consumer->OnUint64Scalar(static_cast<ui64>(value)); \ +} + +SERIALIZE_SIGNED(signed char); +SERIALIZE_SIGNED(short); +SERIALIZE_SIGNED(int); +SERIALIZE_SIGNED(long); +SERIALIZE_SIGNED(long long); + +SERIALIZE_UNSIGNED(unsigned char); +SERIALIZE_UNSIGNED(unsigned short); +SERIALIZE_UNSIGNED(unsigned int); +SERIALIZE_UNSIGNED(unsigned long); +SERIALIZE_UNSIGNED(unsigned long long); + +#undef SERIALIZE_SIGNED +#undef SERIALIZE_UNSIGNED + +void Deserialize(i64& value, const TNode& node) +{ + value = node.AsInt64(); +} + +void Deserialize(ui64& value, const TNode& node) +{ + value = node.AsUint64(); +} + void Serialize(double value, NYson::IYsonConsumer* consumer) -{ - consumer->OnDoubleScalar(value); -} - -void Deserialize(double& value, const TNode& node) -{ - value = node.AsDouble(); -} - +{ + consumer->OnDoubleScalar(value); +} + +void Deserialize(double& value, const TNode& node) +{ + value = node.AsDouble(); +} + void Serialize(bool value, NYson::IYsonConsumer* consumer) -{ - consumer->OnBooleanScalar(value); -} - -void Deserialize(bool& value, const TNode& node) -{ - value = node.AsBool(); -} - +{ + consumer->OnBooleanScalar(value); +} + +void Deserialize(bool& value, const TNode& node) +{ + value = node.AsBool(); +} + void Serialize(const TNode& node, NYson::IYsonConsumer* consumer) -{ - TNodeVisitor visitor(consumer); - visitor.Visit(node); -} - -void Deserialize(TNode& value, const TNode& node) -{ - value = node; -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT +{ + TNodeVisitor visitor(consumer); + visitor.Visit(node); +} + +void Deserialize(TNode& value, const TNode& node) +{ + value = node; +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT |