diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:39 +0300 |
commit | a6a92afe03e02795227d2641b49819b687f088f8 (patch) | |
tree | f6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /library/cpp/yson_pull/detail/input/stdio_file.h | |
parent | c6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff) | |
download | ydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson_pull/detail/input/stdio_file.h')
-rw-r--r-- | library/cpp/yson_pull/detail/input/stdio_file.h | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/library/cpp/yson_pull/detail/input/stdio_file.h b/library/cpp/yson_pull/detail/input/stdio_file.h index c412b7e59b..328931d435 100644 --- a/library/cpp/yson_pull/detail/input/stdio_file.h +++ b/library/cpp/yson_pull/detail/input/stdio_file.h @@ -1,35 +1,35 @@ -#pragma once - -#include "buffered.h" - +#pragma once + +#include "buffered.h" + #include <library/cpp/yson_pull/detail/macros.h> - + #include <library/cpp/yson_pull/exceptions.h> #include <library/cpp/yson_pull/input.h> - -#include <cstdio> -#include <memory> - + +#include <cstdio> +#include <memory> + 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} { } - + protected: result do_fill_buffer() override { auto nread = ::fread(buffer_data(), 1, buffer_size(), file_); - if (Y_UNLIKELY(nread == 0)) { - if (ferror(file_)) { + if (Y_UNLIKELY(nread == 0)) { + if (ferror(file_)) { throw NException::TSystemError(); } - if (feof(file_)) { + if (feof(file_)) { return result::at_end; } } @@ -37,6 +37,6 @@ namespace NYsonPull { return result::have_more_data; } }; - } + } } // namespace NDetail } |