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/detail/input | |
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/detail/input')
-rw-r--r-- | library/cpp/yson_pull/detail/input/buffered.h | 44 | ||||
-rw-r--r-- | library/cpp/yson_pull/detail/input/stdio_file.h | 48 | ||||
-rw-r--r-- | library/cpp/yson_pull/detail/input/stream.h | 8 |
3 files changed, 50 insertions, 50 deletions
diff --git a/library/cpp/yson_pull/detail/input/buffered.h b/library/cpp/yson_pull/detail/input/buffered.h index a0e53cec04..9b1482577f 100644 --- a/library/cpp/yson_pull/detail/input/buffered.h +++ b/library/cpp/yson_pull/detail/input/buffered.h @@ -8,28 +8,28 @@ #include <cstdio> #include <memory> -namespace NYsonPull { - namespace NDetail { - namespace NInput { - class TBuffered: public NYsonPull::NInput::IStream { - TArrayHolder<ui8> buffer_; - size_t size_; +namespace NYsonPull { + namespace NDetail { + namespace NInput { + class TBuffered: public NYsonPull::NInput::IStream { + TArrayHolder<ui8> buffer_; + size_t size_; - public: - explicit TBuffered(size_t buffer_size) - : buffer_{new ui8[buffer_size]} - , size_{buffer_size} { - } + public: + explicit TBuffered(size_t buffer_size) + : buffer_{new ui8[buffer_size]} + , size_{buffer_size} { + } - protected: - ui8* buffer_data() const { - return buffer_.Get(); - } + protected: + ui8* buffer_data() const { + return buffer_.Get(); + } - size_t buffer_size() const { - return size_; - } - }; - } - } // namespace NDetail -} + size_t buffer_size() const { + return size_; + } + }; + } + } // namespace NDetail +} diff --git a/library/cpp/yson_pull/detail/input/stdio_file.h b/library/cpp/yson_pull/detail/input/stdio_file.h index c27b736aa3..c412b7e59b 100644 --- a/library/cpp/yson_pull/detail/input/stdio_file.h +++ b/library/cpp/yson_pull/detail/input/stdio_file.h @@ -10,33 +10,33 @@ #include <cstdio> #include <memory> -namespace NYsonPull { - namespace NDetail { - namespace NInput { - class TStdioFile: public TBuffered { - FILE* file_; +namespace NYsonPull { + namespace NDetail { + namespace NInput { + class TStdioFile: public TBuffered { + FILE* file_; - public: - TStdioFile(FILE* file, size_t buffer_size) - : TBuffered(buffer_size) - , file_{file} { - } + public: + TStdioFile(FILE* file, size_t buffer_size) + : TBuffered(buffer_size) + , file_{file} { + } - protected: - result do_fill_buffer() override { - auto nread = ::fread(buffer_data(), 1, buffer_size(), file_); + protected: + result do_fill_buffer() override { + auto nread = ::fread(buffer_data(), 1, buffer_size(), file_); if (Y_UNLIKELY(nread == 0)) { if (ferror(file_)) { - throw NException::TSystemError(); - } + throw NException::TSystemError(); + } if (feof(file_)) { - return result::at_end; - } - } - buffer().reset(buffer_data(), buffer_data() + nread); - return result::have_more_data; - } - }; + return result::at_end; + } + } + buffer().reset(buffer_data(), buffer_data() + nread); + return result::have_more_data; + } + }; } - } // namespace NDetail -} + } // namespace NDetail +} diff --git a/library/cpp/yson_pull/detail/input/stream.h b/library/cpp/yson_pull/detail/input/stream.h index d93ac8eaf8..791cd5a3f5 100644 --- a/library/cpp/yson_pull/detail/input/stream.h +++ b/library/cpp/yson_pull/detail/input/stream.h @@ -40,12 +40,12 @@ namespace NYsonPull { } }; - template <typename TBuffered> + template <typename TBuffered> class TOwned: public TStreamBase { TBuffered Input; public: - template <typename... Args> + template <typename... Args> explicit TOwned(Args&&... args) : Input(std::forward<Args>(args)...) { @@ -65,5 +65,5 @@ namespace NYsonPull { } }; } - } // namespace NDetail -} + } // namespace NDetail +} |