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 | 298c6da79f1d8f35089a67f463f0b541bec36d9b (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/stream | |
parent | 00afc96e9c0298054b7386fa7fb9e3cc3d67b974 (diff) | |
download | ydb-298c6da79f1d8f35089a67f463f0b541bec36d9b.tar.gz |
Restoring authorship annotation for <akhropov@yandex-team.ru>. Commit 2 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 69ce49155c..afd5b3e1c7 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 5a01c2f1ae..6e8170f2f9 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 878a2ff194..18a5d46772 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 66519fb796..4e8b298145 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 d0e1a78b57..51be1934a7 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 bbd98a6fbd..18525b9517 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 d059c367d0..99873b95ba 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 623d44be32..c69e232fb9 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 eb60ac9dc4..60f4e9439f 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) { |