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/parser.cpp | |
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/parser.cpp')
-rw-r--r-- | library/cpp/yson/parser.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/library/cpp/yson/parser.cpp b/library/cpp/yson/parser.cpp index 3af222ed4e..783f9b9047 100644 --- a/library/cpp/yson/parser.cpp +++ b/library/cpp/yson/parser.cpp @@ -1,14 +1,14 @@ -#include "parser.h" -#include "consumer.h" -#include "format.h" -#include "parser_detail.h" - -#include <util/stream/input.h> -#include <util/generic/buffer.h> - +#include "parser.h" +#include "consumer.h" +#include "format.h" +#include "parser_detail.h" + +#include <util/stream/input.h> +#include <util/generic/buffer.h> + namespace NYson { //////////////////////////////////////////////////////////////////////////////// - + class TYsonParser::TImpl { public: TImpl( @@ -24,7 +24,7 @@ namespace NYson { , MemoryLimit_(memoryLimit) { } - + void Parse() { TBuffer buffer(64 << 10); ParseYsonStreamImpl<NYT::NYson::IYsonConsumer, TStreamReader>( @@ -48,26 +48,26 @@ namespace NYson { TYsonParser::TYsonParser( NYT::NYson::IYsonConsumer* consumer, IInputStream* stream, - EYsonType type, - bool enableLinePositionInfo, + EYsonType type, + bool enableLinePositionInfo, TMaybe<ui64> memoryLimit) : Impl(new TImpl(consumer, stream, type, enableLinePositionInfo, memoryLimit)) - { - } - + { + } + TYsonParser::~TYsonParser() { } - + void TYsonParser::Parse() { Impl->Parse(); } - + //////////////////////////////////////////////////////////////////////////////// - + class TStatelessYsonParser::TImpl { private: THolder<TStatelessYsonParserImplBase> Impl; - + public: TImpl( NYT::NYson::IYsonConsumer* consumer, @@ -79,31 +79,31 @@ namespace NYson { : static_cast<TStatelessYsonParserImplBase*>(new TStatelessYsonParserImpl<NYT::NYson::IYsonConsumer, false>(consumer, memoryLimit))) { } - + void Parse(const TStringBuf& data, EYsonType type = ::NYson::EYsonType::Node) { Impl->Parse(data, type); } }; - + //////////////////////////////////////////////////////////////////////////////// - + TStatelessYsonParser::TStatelessYsonParser( NYT::NYson::IYsonConsumer* consumer, - bool enableLinePositionInfo, - TMaybe<ui64> memoryLimit) + bool enableLinePositionInfo, + TMaybe<ui64> memoryLimit) : Impl(new TImpl(consumer, enableLinePositionInfo, memoryLimit)) { } - + TStatelessYsonParser::~TStatelessYsonParser() { } void TStatelessYsonParser::Parse(const TStringBuf& data, EYsonType type) { - Impl->Parse(data, type); - } - + Impl->Parse(data, type); + } + //////////////////////////////////////////////////////////////////////////////// - + void ParseYsonStringBuffer( const TStringBuf& buffer, NYT::NYson::IYsonConsumer* consumer, @@ -117,9 +117,9 @@ namespace NYson { enableLinePositionInfo, memoryLimit); } - + //////////////////////////////////////////////////////////////////////////////// - + class TYsonListParser::TImpl { public: TImpl( @@ -135,7 +135,7 @@ namespace NYson { , Reader_(Stream_, Buffer_.Data(), Buffer_.Capacity()) { } - + bool Parse() { if (!Impl_) { Impl_.Reset( @@ -145,7 +145,7 @@ namespace NYson { } return Impl_->Parse(); } - + private: NYT::NYson::IYsonConsumer* Consumer_; IInputStream* Stream_; @@ -155,9 +155,9 @@ namespace NYson { TStreamReader Reader_; THolder<TYsonListParserImplBase> Impl_; }; - + //////////////////////////////////////////////////////////////////////////////// - + TYsonListParser::TYsonListParser( NYT::NYson::IYsonConsumer* consumer, IInputStream* stream, |