diff options
author | Alexander Fokin <apfokin@gmail.com> | 2022-02-10 16:45:38 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:38 +0300 |
commit | 863a59a65247c24db7cb06789bc5cf79d04da32f (patch) | |
tree | 139dc000c8cd4a40f5659e421b7c75135d080307 /util/stream/buffer.cpp | |
parent | f64e95a9eb9ab03240599eb9581c5a9102426a96 (diff) | |
download | ydb-863a59a65247c24db7cb06789bc5cf79d04da32f.tar.gz |
Restoring authorship annotation for Alexander Fokin <apfokin@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/stream/buffer.cpp')
-rw-r--r-- | util/stream/buffer.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/util/stream/buffer.cpp b/util/stream/buffer.cpp index 2facece4ea..9c353af400 100644 --- a/util/stream/buffer.cpp +++ b/util/stream/buffer.cpp @@ -66,15 +66,15 @@ TBufferOutput::TBufferOutput(TBuffer& buffer) { } -TBufferOutput::TBufferOutput(TBufferOutput&&) noexcept = default; -TBufferOutput& TBufferOutput::operator=(TBufferOutput&&) noexcept = default; - +TBufferOutput::TBufferOutput(TBufferOutput&&) noexcept = default; +TBufferOutput& TBufferOutput::operator=(TBufferOutput&&) noexcept = default; + TBufferOutput::~TBufferOutput() = default; TBuffer& TBufferOutput::Buffer() const noexcept { - return Impl_->Buffer(); -} - + return Impl_->Buffer(); +} + size_t TBufferOutput::DoNext(void** ptr) { return Impl_->DoNext(ptr); } @@ -91,28 +91,28 @@ void TBufferOutput::DoWriteC(char c) { Impl_->DoWriteC(c); } -TBufferInput::TBufferInput(const TBuffer& buffer) - : Buf_(buffer) - , Readed_(0) -{ +TBufferInput::TBufferInput(const TBuffer& buffer) + : Buf_(buffer) + , Readed_(0) +{ } TBufferInput::~TBufferInput() = default; - + const TBuffer& TBufferInput::Buffer() const noexcept { - return Buf_; -} - + return Buf_; +} + void TBufferInput::Rewind() noexcept { - Readed_ = 0; -} - -size_t TBufferInput::DoNext(const void** ptr, size_t len) { - len = Min(Buf_.Size() - Readed_, len); + Readed_ = 0; +} + +size_t TBufferInput::DoNext(const void** ptr, size_t len) { + len = Min(Buf_.Size() - Readed_, len); *ptr = Buf_.data() + Readed_; - Readed_ += len; - return len; -} + Readed_ += len; + return len; +} void TBufferInput::DoUndo(size_t len) { Y_VERIFY(len <= Readed_); |