diff options
author | monster <monster@yandex-team.ru> | 2022-02-10 16:47:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:19 +0300 |
commit | b23c1d7a8015c2006a148fd93b84cdeb0aee17a3 (patch) | |
tree | 9814fbd1c3effac9b8377c5d604b367b14e2db55 /library/cpp/yson/writer.h | |
parent | dd76ae1f6213d065375ab296699f764faafbe5bd (diff) | |
download | ydb-b23c1d7a8015c2006a148fd93b84cdeb0aee17a3.tar.gz |
Restoring authorship annotation for <monster@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson/writer.h')
-rw-r--r-- | library/cpp/yson/writer.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/library/cpp/yson/writer.h b/library/cpp/yson/writer.h index 0ae04be6e8..40f5d7d501 100644 --- a/library/cpp/yson/writer.h +++ b/library/cpp/yson/writer.h @@ -1,17 +1,17 @@ -#pragma once - -#include "public.h" -#include "token.h" -#include "consumer.h" - -#include <util/generic/noncopyable.h> - +#pragma once + +#include "public.h" +#include "token.h" +#include "consumer.h" + +#include <util/generic/noncopyable.h> + class IOutputStream; class IZeroCopyInput; - + namespace NYson { //////////////////////////////////////////////////////////////////////////////// - + class TYsonWriter : public TYsonConsumerBase, private TNonCopyable { @@ -20,7 +20,7 @@ namespace NYson { private: int Depth; bool BeforeFirstItem; - + friend class TYsonWriter; }; @@ -37,23 +37,23 @@ namespace NYson { void OnDoubleScalar(double value) override; void OnBooleanScalar(bool value) override; void OnEntity() override; - + void OnBeginList() override; void OnListItem() override; void OnEndList() override; - + void OnBeginMap() override; void OnKeyedItem(TStringBuf key) override; void OnEndMap() override; - + void OnBeginAttributes() override; void OnEndAttributes() override; - + void OnRaw(TStringBuf yson, EYsonType type = ::NYson::EYsonType::Node) override; - + TState State() const; void Reset(const TState& state); - + protected: IOutputStream* Stream; EYsonFormat Format; @@ -62,28 +62,28 @@ namespace NYson { int Depth; bool BeforeFirstItem; - + static const int IndentSize = 4; - + void WriteIndent(); void WriteStringScalar(const TStringBuf& value); - + void BeginCollection(ETokenType beginToken); void CollectionItem(ETokenType separatorToken); void EndCollection(ETokenType endToken); - + bool IsTopLevelFragmentContext() const; void EndNode(); }; - + //////////////////////////////////////////////////////////////////////////////// - + void ReformatYsonStream( IInputStream* input, IOutputStream* output, EYsonFormat format = EYsonFormat::Binary, EYsonType type = ::NYson::EYsonType::Node); - + //////////////////////////////////////////////////////////////////////////////// - + } // namespace NYson |