diff options
author | ekrokhalev <ekrokhalev@yandex-team.ru> | 2022-02-10 16:50:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:10 +0300 |
commit | 1c01ed5294724fda060c1f0bd674b315fe249598 (patch) | |
tree | c21292982d2c8182cdf5753f9a49e7cda547f4d3 /util/stream | |
parent | 9991a6195dee8db26aa7e2f5f21549fb20e25002 (diff) | |
download | ydb-1c01ed5294724fda060c1f0bd674b315fe249598.tar.gz |
Restoring authorship annotation for <ekrokhalev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r-- | util/stream/pipe.cpp | 56 | ||||
-rw-r--r-- | util/stream/pipe.h | 18 |
2 files changed, 37 insertions, 37 deletions
diff --git a/util/stream/pipe.cpp b/util/stream/pipe.cpp index 51be1934a7..556c5766d7 100644 --- a/util/stream/pipe.cpp +++ b/util/stream/pipe.cpp @@ -82,40 +82,40 @@ void TPipeOutput::Close() { } } -TPipedBase::TPipedBase(PIPEHANDLE fd) - : Handle_(fd) -{ -} - +TPipedBase::TPipedBase(PIPEHANDLE fd) + : Handle_(fd) +{ +} + TPipedBase::~TPipedBase() { if (Handle_.IsOpen()) { - Handle_.Close(); + Handle_.Close(); } -} - +} + TPipedInput::TPipedInput(PIPEHANDLE fd) - : TPipedBase(fd) -{ -} - + : TPipedBase(fd) +{ +} + TPipedInput::~TPipedInput() = default; - -size_t TPipedInput::DoRead(void* buf, size_t len) { + +size_t TPipedInput::DoRead(void* buf, size_t len) { if (!Handle_.IsOpen()) { - return 0; + return 0; } return Handle_.Read(buf, len); -} - -TPipedOutput::TPipedOutput(PIPEHANDLE fd) - : TPipedBase(fd) -{ -} - +} + +TPipedOutput::TPipedOutput(PIPEHANDLE fd) + : TPipedBase(fd) +{ +} + TPipedOutput::~TPipedOutput() = default; - -void TPipedOutput::DoWrite(const void* buf, size_t len) { - if (!Handle_.IsOpen() || static_cast<ssize_t>(len) != Handle_.Write(buf, len)) { - ythrow TSystemError() << "pipe writing failed"; - } -} + +void TPipedOutput::DoWrite(const void* buf, size_t len) { + if (!Handle_.IsOpen() || static_cast<ssize_t>(len) != Handle_.Write(buf, len)) { + ythrow TSystemError() << "pipe writing failed"; + } +} diff --git a/util/stream/pipe.h b/util/stream/pipe.h index 18525b9517..7ef5766e6e 100644 --- a/util/stream/pipe.h +++ b/util/stream/pipe.h @@ -76,15 +76,15 @@ private: void DoWrite(const void* buf, size_t len) override; }; -class TPipedBase { +class TPipedBase { protected: TPipedBase(PIPEHANDLE fd); virtual ~TPipedBase(); protected: TPipeHandle Handle_; -}; - +}; + /** * Input stream that binds to a standard output stream of an existing process. */ @@ -92,11 +92,11 @@ class TPipedInput: public TPipedBase, public IInputStream { public: TPipedInput(PIPEHANDLE fd); ~TPipedInput() override; - + private: size_t DoRead(void* buf, size_t len) override; -}; - +}; + /** * Output stream that binds to a standard input stream of an existing process. */ @@ -104,9 +104,9 @@ class TPipedOutput: public TPipedBase, public IOutputStream { public: TPipedOutput(PIPEHANDLE fd); ~TPipedOutput() override; - + private: void DoWrite(const void* buf, size_t len) override; -}; - +}; + /** @} */ |