diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/yson_pull/writer.h | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson_pull/writer.h')
-rw-r--r-- | library/cpp/yson_pull/writer.h | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/library/cpp/yson_pull/writer.h b/library/cpp/yson_pull/writer.h index df11084e28..dec63328be 100644 --- a/library/cpp/yson_pull/writer.h +++ b/library/cpp/yson_pull/writer.h @@ -8,119 +8,119 @@ #include <memory> namespace NYsonPull { - //! \brief YSON writer facade class - //! - //! Owns a YSON consumer and a corresponding output stream. - //! Methods invoke corresponding \p NYsonPull::IConsumer methods and can be chained. - class TWriter { + //! \brief YSON writer facade class + //! + //! Owns a YSON consumer and a corresponding output stream. + //! Methods invoke corresponding \p NYsonPull::IConsumer methods and can be chained. + class TWriter { THolder<NOutput::IStream> Stream_; THolder<IConsumer> Impl_; - public: - TWriter( - THolder<NOutput::IStream> stream, - THolder<IConsumer> impl) + public: + TWriter( + THolder<NOutput::IStream> stream, + THolder<IConsumer> impl) : Stream_{std::move(stream)} , Impl_{std::move(impl)} { - } + } - //! \brief Get a reference to underlying consumer. - //! - //! Useful with \p NYsonPull::bridge + //! \brief Get a reference to underlying consumer. + //! + //! Useful with \p NYsonPull::bridge IConsumer& GetConsumer() { return *Impl_; - } + } TWriter& BeginStream() { Impl_->OnBeginStream(); - return *this; - } + return *this; + } TWriter& EndStream() { Impl_->OnEndStream(); - return *this; - } + return *this; + } TWriter& BeginList() { Impl_->OnBeginList(); - return *this; - } + return *this; + } TWriter& EndList() { Impl_->OnEndList(); - return *this; - } + return *this; + } TWriter& BeginMap() { Impl_->OnBeginMap(); - return *this; - } + return *this; + } TWriter& EndMap() { Impl_->OnEndMap(); - return *this; - } + return *this; + } TWriter& BeginAttributes() { Impl_->OnBeginAttributes(); - return *this; - } + return *this; + } TWriter& EndAttributes() { Impl_->OnEndAttributes(); - return *this; - } + return *this; + } TWriter& Key(TStringBuf name) { Impl_->OnKey(name); - return *this; - } + return *this; + } TWriter& Entity() { Impl_->OnEntity(); - return *this; - } + return *this; + } TWriter& Boolean(bool value) { Impl_->OnScalarBoolean(value); - return *this; - } + return *this; + } TWriter& Int64(i64 value) { Impl_->OnScalarInt64(value); - return *this; - } + return *this; + } TWriter& UInt64(ui64 value) { Impl_->OnScalarUInt64(value); - return *this; - } + return *this; + } TWriter& Float64(double value) { Impl_->OnScalarFloat64(value); - return *this; - } + return *this; + } TWriter& String(TStringBuf value) { Impl_->OnScalarString(value); - return *this; - } + return *this; + } TWriter& Scalar(const TScalar& value) { Impl_->OnScalar(value); - return *this; - } + return *this; + } TWriter& Event(const TEvent& value) { Impl_->OnEvent(value); - return *this; - } - }; + return *this; + } + }; - //! \brief Construct a writer for binary YSON format. + //! \brief Construct a writer for binary YSON format. TWriter MakeBinaryWriter( - THolder<NOutput::IStream> stream, - EStreamType mode); + THolder<NOutput::IStream> stream, + EStreamType mode); - //! \brief Construct a writer for text YSON format. + //! \brief Construct a writer for text YSON format. TWriter MakeTextWriter( - THolder<NOutput::IStream> stream, - EStreamType mode); + THolder<NOutput::IStream> stream, + EStreamType mode); - //! \brief Construct a writer for pretty text YSON format. + //! \brief Construct a writer for pretty text YSON format. TWriter MakePrettyTextWriter( - THolder<NOutput::IStream> stream, - EStreamType mode, - size_t indent_size = 4); + THolder<NOutput::IStream> stream, + EStreamType mode, + size_t indent_size = 4); -} +} |