aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson_pull/output.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/yson_pull/output.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yson_pull/output.h')
-rw-r--r--library/cpp/yson_pull/output.h68
1 files changed, 34 insertions, 34 deletions
diff --git a/library/cpp/yson_pull/output.h b/library/cpp/yson_pull/output.h
index 2d78107a93..fbe8a84ce7 100644
--- a/library/cpp/yson_pull/output.h
+++ b/library/cpp/yson_pull/output.h
@@ -15,42 +15,42 @@
//! \brief Output stream adaptor interface.
//!
//! Represents a model of an optionally-buffered writer.
-namespace NYsonPull {
- namespace NOutput {
- class IStream {
- output_buffer buffer_;
+namespace NYsonPull {
+ namespace NOutput {
+ class IStream {
+ output_buffer buffer_;
- public:
- virtual ~IStream() = default;
+ public:
+ virtual ~IStream() = default;
- output_buffer& buffer() noexcept {
- return buffer_;
- }
- const output_buffer& buffer() const noexcept {
- return buffer_;
- }
+ output_buffer& buffer() noexcept {
+ return buffer_;
+ }
+ const output_buffer& buffer() const noexcept {
+ return buffer_;
+ }
- void flush_buffer(TStringBuf extra = {}) {
- if (!extra.empty() || !buffer_.is_empty()) {
- do_flush_buffer(extra);
- }
- while (!buffer_.is_empty()) {
- do_flush_buffer({});
- }
- }
+ void flush_buffer(TStringBuf extra = {}) {
+ if (!extra.empty() || !buffer_.is_empty()) {
+ do_flush_buffer(extra);
+ }
+ while (!buffer_.is_empty()) {
+ do_flush_buffer({});
+ }
+ }
- protected:
- //! \brief Flush data to underlying stream.
- //!
- //! The implementation is to flush the buffer contents AND
- //! extra argument to underlying stream.
- //!
- //! This way, at zero buffer size this interface implements an unbuffered
- //! stream (with an added cost of a virtual call per each write).
- //!
- //! Write is assumed to always succeed unless it throws an exception.
- virtual void do_flush_buffer(TStringBuf extra) = 0;
- };
+ protected:
+ //! \brief Flush data to underlying stream.
+ //!
+ //! The implementation is to flush the buffer contents AND
+ //! extra argument to underlying stream.
+ //!
+ //! This way, at zero buffer size this interface implements an unbuffered
+ //! stream (with an added cost of a virtual call per each write).
+ //!
+ //! Write is assumed to always succeed unless it throws an exception.
+ virtual void do_flush_buffer(TStringBuf extra) = 0;
+ };
//! \brief Write data to C FILE* object.
THolder<IStream> FromStdioFile(FILE* file, size_t buffer_size = 0);
@@ -61,5 +61,5 @@ namespace NYsonPull {
THolder<IStream> FromOutputStream(IOutputStream* output, size_t buffer_size = 65536);
THolder<IStream> FromString(TString* output, size_t buffer_size = 1024);
- }
-}
+ }
+}