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 | 883d905c560ebed4b7f38d021b424d75c4521a6f (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/yt/yson | |
parent | b6e35c760e81fe851ac4da1abc08e6ec8e779c10 (diff) | |
download | ydb-883d905c560ebed4b7f38d021b424d75c4521a6f.tar.gz |
Restoring authorship annotation for <nadya73@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yt/yson')
-rw-r--r-- | library/cpp/yt/yson/consumer.cpp | 28 | ||||
-rw-r--r-- | library/cpp/yt/yson/consumer.h | 216 | ||||
-rw-r--r-- | library/cpp/yt/yson/public.h | 22 | ||||
-rw-r--r-- | library/cpp/yt/yson/ya.make | 22 |
4 files changed, 144 insertions, 144 deletions
diff --git a/library/cpp/yt/yson/consumer.cpp b/library/cpp/yt/yson/consumer.cpp index d3aec4aa5e..9b68ee8a22 100644 --- a/library/cpp/yt/yson/consumer.cpp +++ b/library/cpp/yt/yson/consumer.cpp @@ -1,16 +1,16 @@ -#include "consumer.h" - -#include <library/cpp/yt/yson_string/string.h> - -namespace NYT::NYson { - -//////////////////////////////////////////////////////////////////////////////// - +#include "consumer.h" + +#include <library/cpp/yt/yson_string/string.h> + +namespace NYT::NYson { + +//////////////////////////////////////////////////////////////////////////////// + void IYsonConsumer::OnRaw(const TYsonStringBuf& yson) { - OnRaw(yson.AsStringBuf(), yson.GetType()); -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT::NYson + OnRaw(yson.AsStringBuf(), yson.GetType()); +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT::NYson diff --git a/library/cpp/yt/yson/consumer.h b/library/cpp/yt/yson/consumer.h index ce295ad608..ea5f586b91 100644 --- a/library/cpp/yt/yson/consumer.h +++ b/library/cpp/yt/yson/consumer.h @@ -1,111 +1,111 @@ -#pragma once - -#include <util/generic/strbuf.h> - -#include <util/system/defaults.h> - -#include <library/cpp/yt/yson_string/public.h> - -namespace NYT::NYson { - -//////////////////////////////////////////////////////////////////////////////// - -//! A SAX-like interface for parsing a YSON stream. +#pragma once + +#include <util/generic/strbuf.h> + +#include <util/system/defaults.h> + +#include <library/cpp/yt/yson_string/public.h> + +namespace NYT::NYson { + +//////////////////////////////////////////////////////////////////////////////// + +//! A SAX-like interface for parsing a YSON stream. struct IYsonConsumer { virtual ~IYsonConsumer() = default; - - //! The current item is a string scalar (IStringNode). - /*! - * \param value A scalar value. - */ - virtual void OnStringScalar(TStringBuf value) = 0; - - //! The current item is an integer scalar (IInt64Node). - /*! - * \param value A scalar value. - */ - virtual void OnInt64Scalar(i64 value) = 0; - - //! The current item is an integer scalar (IUint64Node). - /*! - * \param value A scalar value. - */ - virtual void OnUint64Scalar(ui64 scalar) = 0; - - //! The current item is an FP scalar (IDoubleNode). - /*! - * \param value A scalar value. - */ - virtual void OnDoubleScalar(double value) = 0; - - //! The current item is an boolean scalar (IBooleanNode). - /*! - * \param value A scalar value. - */ - virtual void OnBooleanScalar(bool value) = 0; - - //! The current item is an entity (IEntityNode). - virtual void OnEntity() = 0; - - //! Starts a list (IListNode). - /*! - * The events describing a list are raised as follows: - * - #OnBeginList - * - For each item: #OnListItem followed by the description of the item - * - #OnEndList - */ - virtual void OnBeginList() = 0; - - //! Designates a list item. - virtual void OnListItem() = 0; - - //! Ends the current list. - virtual void OnEndList() = 0; - - //! Starts a map (IMapNode). - /*! - * The events describing a map are raised as follows: - * - #OnBeginMap - * - For each item: #OnKeyedItem followed by the description of the item - * - #OnEndMap - */ - virtual void OnBeginMap() = 0; - - //! Designates a keyed item (in map or in attributes). - /*! - * \param key Item key in the map. - */ - virtual void OnKeyedItem(TStringBuf key) = 0; - - //! Ends the current map. - virtual void OnEndMap() = 0; - - //! Starts attributes. - /*! - * An arbitrary node may be preceeded by attributes. - * - * The events describing attributes are raised as follows: - * - #OnBeginAttributes - * - For each item: #OnKeyedItem followed by the description of the item - * - #OnEndAttributes - */ - virtual void OnBeginAttributes() = 0; - - //! Ends the current attribute list. - virtual void OnEndAttributes() = 0; - - //! Inserts YSON-serialized node or fragment. - /*! - * \param yson Serialized data. - * \param type Type of data. - */ - virtual void OnRaw(TStringBuf yson, EYsonType type) = 0; - - // Extension methods. - void OnRaw(const TYsonStringBuf& yson); -}; - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT::NYson + + //! The current item is a string scalar (IStringNode). + /*! + * \param value A scalar value. + */ + virtual void OnStringScalar(TStringBuf value) = 0; + + //! The current item is an integer scalar (IInt64Node). + /*! + * \param value A scalar value. + */ + virtual void OnInt64Scalar(i64 value) = 0; + + //! The current item is an integer scalar (IUint64Node). + /*! + * \param value A scalar value. + */ + virtual void OnUint64Scalar(ui64 scalar) = 0; + + //! The current item is an FP scalar (IDoubleNode). + /*! + * \param value A scalar value. + */ + virtual void OnDoubleScalar(double value) = 0; + + //! The current item is an boolean scalar (IBooleanNode). + /*! + * \param value A scalar value. + */ + virtual void OnBooleanScalar(bool value) = 0; + + //! The current item is an entity (IEntityNode). + virtual void OnEntity() = 0; + + //! Starts a list (IListNode). + /*! + * The events describing a list are raised as follows: + * - #OnBeginList + * - For each item: #OnListItem followed by the description of the item + * - #OnEndList + */ + virtual void OnBeginList() = 0; + + //! Designates a list item. + virtual void OnListItem() = 0; + + //! Ends the current list. + virtual void OnEndList() = 0; + + //! Starts a map (IMapNode). + /*! + * The events describing a map are raised as follows: + * - #OnBeginMap + * - For each item: #OnKeyedItem followed by the description of the item + * - #OnEndMap + */ + virtual void OnBeginMap() = 0; + + //! Designates a keyed item (in map or in attributes). + /*! + * \param key Item key in the map. + */ + virtual void OnKeyedItem(TStringBuf key) = 0; + + //! Ends the current map. + virtual void OnEndMap() = 0; + + //! Starts attributes. + /*! + * An arbitrary node may be preceeded by attributes. + * + * The events describing attributes are raised as follows: + * - #OnBeginAttributes + * - For each item: #OnKeyedItem followed by the description of the item + * - #OnEndAttributes + */ + virtual void OnBeginAttributes() = 0; + + //! Ends the current attribute list. + virtual void OnEndAttributes() = 0; + + //! Inserts YSON-serialized node or fragment. + /*! + * \param yson Serialized data. + * \param type Type of data. + */ + virtual void OnRaw(TStringBuf yson, EYsonType type) = 0; + + // Extension methods. + void OnRaw(const TYsonStringBuf& yson); +}; + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT::NYson diff --git a/library/cpp/yt/yson/public.h b/library/cpp/yt/yson/public.h index d68c0558e2..68cdcd38c1 100644 --- a/library/cpp/yt/yson/public.h +++ b/library/cpp/yt/yson/public.h @@ -1,11 +1,11 @@ -#pragma once - -namespace NYT::NYson { - -//////////////////////////////////////////////////////////////////////////////// - -struct IYsonConsumer; - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace NYT::NYson +#pragma once + +namespace NYT::NYson { + +//////////////////////////////////////////////////////////////////////////////// + +struct IYsonConsumer; + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT::NYson diff --git a/library/cpp/yt/yson/ya.make b/library/cpp/yt/yson/ya.make index 8aa894d953..d914352c4b 100644 --- a/library/cpp/yt/yson/ya.make +++ b/library/cpp/yt/yson/ya.make @@ -1,11 +1,11 @@ -LIBRARY() - -SRCS( - consumer.cpp -) - -PEERDIR( - library/cpp/yt/yson_string -) - -END() +LIBRARY() + +SRCS( + consumer.cpp +) + +PEERDIR( + library/cpp/yt/yson_string +) + +END() |