diff options
author | akhropov <akhropov@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:32 +0300 |
commit | 00afc96e9c0298054b7386fa7fb9e3cc3d67b974 (patch) | |
tree | cb7a9f4a92c0d4cc5a86eeed49ad71e810953c1f /util/stream | |
parent | 83a8efcf3af051e3dd59c00d1d5dafc96412ec1e (diff) | |
download | ydb-00afc96e9c0298054b7386fa7fb9e3cc3d67b974.tar.gz |
Restoring authorship annotation for <akhropov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r-- | util/stream/debug.cpp | 2 | ||||
-rw-r--r-- | util/stream/input.cpp | 8 | ||||
-rw-r--r-- | util/stream/mem.h | 2 | ||||
-rw-r--r-- | util/stream/null.cpp | 8 | ||||
-rw-r--r-- | util/stream/pipe.cpp | 14 | ||||
-rw-r--r-- | util/stream/pipe.h | 8 | ||||
-rw-r--r-- | util/stream/tee.cpp | 22 | ||||
-rw-r--r-- | util/stream/tee.h | 8 | ||||
-rw-r--r-- | util/stream/zlib.cpp | 8 |
9 files changed, 40 insertions, 40 deletions
diff --git a/util/stream/debug.cpp b/util/stream/debug.cpp index afd5b3e1c7..69ce49155c 100644 --- a/util/stream/debug.cpp +++ b/util/stream/debug.cpp @@ -30,7 +30,7 @@ namespace { Level = 0; } } - + IOutputStream* Out; int Level; }; diff --git a/util/stream/input.cpp b/util/stream/input.cpp index 6e8170f2f9..5a01c2f1ae 100644 --- a/util/stream/input.cpp +++ b/util/stream/input.cpp @@ -258,19 +258,19 @@ IInputStream& NPrivate::StdInStream() noexcept { // helper functions -static inline bool IsStdDelimiter(char c) { +static inline bool IsStdDelimiter(char c) { return (c == '\0') || (c == ' ') || (c == '\r') || (c == '\n') || (c == '\t'); } static void ReadUpToDelimiter(IInputStream& i, TString& s) { char c; while (i.ReadChar(c)) { // skip delimiters - if (!IsStdDelimiter(c)) { + if (!IsStdDelimiter(c)) { s += c; break; } } - while (i.ReadChar(c) && !IsStdDelimiter(c)) { // read data (with trailing delimiter) + while (i.ReadChar(c) && !IsStdDelimiter(c)) { // read data (with trailing delimiter) s += c; } } @@ -279,7 +279,7 @@ static void ReadUpToDelimiter(IInputStream& i, TString& s) { template <> void In<TString>(IInputStream& i, TString& s) { - s.resize(0); + s.resize(0); ReadUpToDelimiter(i, s); } diff --git a/util/stream/mem.h b/util/stream/mem.h index 18a5d46772..878a2ff194 100644 --- a/util/stream/mem.h +++ b/util/stream/mem.h @@ -82,7 +82,7 @@ public: const char* Buf() const noexcept { return Buf_; } - + /** * Initializes this stream with a next chunk extracted from the given zero * copy stream. diff --git a/util/stream/null.cpp b/util/stream/null.cpp index 4e8b298145..66519fb796 100644 --- a/util/stream/null.cpp +++ b/util/stream/null.cpp @@ -7,10 +7,10 @@ TNullIO& NPrivate::StdNullStream() noexcept { } TNullInput::TNullInput() noexcept { -} - +} + TNullInput::~TNullInput() = default; - + size_t TNullInput::DoRead(void*, size_t) { return 0; } @@ -24,7 +24,7 @@ size_t TNullInput::DoNext(const void**, size_t) { } TNullOutput::TNullOutput() noexcept = default; - + TNullOutput::~TNullOutput() = default; void TNullOutput::DoWrite(const void* /*buf*/, size_t /*len*/) { diff --git a/util/stream/pipe.cpp b/util/stream/pipe.cpp index 51be1934a7..d0e1a78b57 100644 --- a/util/stream/pipe.cpp +++ b/util/stream/pipe.cpp @@ -33,17 +33,17 @@ public: TPipeBase::TPipeBase(const TString& command, const char* mode) : Impl_(new TImpl(command, mode)) -{ -} - +{ +} + TPipeBase::~TPipeBase() = default; - + TPipeInput::TPipeInput(const TString& command) : TPipeBase(command, "r") { } -size_t TPipeInput::DoRead(void* buf, size_t len) { +size_t TPipeInput::DoRead(void* buf, size_t len) { if (Impl_->Pipe_ == nullptr) { return 0; } @@ -59,8 +59,8 @@ size_t TPipeInput::DoRead(void* buf, size_t len) { } } return bytesRead; -} - +} + TPipeOutput::TPipeOutput(const TString& command) : TPipeBase(command, "w") { diff --git a/util/stream/pipe.h b/util/stream/pipe.h index 18525b9517..bbd98a6fbd 100644 --- a/util/stream/pipe.h +++ b/util/stream/pipe.h @@ -46,11 +46,11 @@ public: * @param command Command line to start a process with. */ TPipeInput(const TString& command); - + private: size_t DoRead(void* buf, size_t len) override; }; - + /** * Output stream that binds to a standard input stream of a newly started process. * @@ -74,8 +74,8 @@ public: private: void DoWrite(const void* buf, size_t len) override; -}; - +}; + class TPipedBase { protected: TPipedBase(PIPEHANDLE fd); diff --git a/util/stream/tee.cpp b/util/stream/tee.cpp index 99873b95ba..d059c367d0 100644 --- a/util/stream/tee.cpp +++ b/util/stream/tee.cpp @@ -4,21 +4,21 @@ TTeeOutput::TTeeOutput(IOutputStream* l, IOutputStream* r) noexcept : L_(l) , R_(r) { -} - +} + TTeeOutput::~TTeeOutput() = default; - -void TTeeOutput::DoWrite(const void* buf, size_t len) { + +void TTeeOutput::DoWrite(const void* buf, size_t len) { L_->Write(buf, len); R_->Write(buf, len); -} - -void TTeeOutput::DoFlush() { +} + +void TTeeOutput::DoFlush() { L_->Flush(); R_->Flush(); -} - -void TTeeOutput::DoFinish() { +} + +void TTeeOutput::DoFinish() { L_->Finish(); R_->Finish(); -} +} diff --git a/util/stream/tee.h b/util/stream/tee.h index c69e232fb9..623d44be32 100644 --- a/util/stream/tee.h +++ b/util/stream/tee.h @@ -14,15 +14,15 @@ class TTeeOutput: public IOutputStream { public: TTeeOutput(IOutputStream* l, IOutputStream* r) noexcept; ~TTeeOutput() override; - + private: void DoWrite(const void* buf, size_t len) override; void DoFlush() override; void DoFinish() override; - + private: IOutputStream* L_; IOutputStream* R_; -}; - +}; + /** @} */ diff --git a/util/stream/zlib.cpp b/util/stream/zlib.cpp index 60f4e9439f..eb60ac9dc4 100644 --- a/util/stream/zlib.cpp +++ b/util/stream/zlib.cpp @@ -348,11 +348,11 @@ void TZLibCompress::TDestruct::Destroy(TImpl* impl) { } TZLibCompress::~TZLibCompress() { - try { - Finish(); - } catch (...) { + try { + Finish(); + } catch (...) { // ¯\_(ツ)_/¯ - } + } } void TZLibCompress::DoWrite(const void* buf, size_t size) { |