aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream
diff options
context:
space:
mode:
authorsereglond <sereglond@yandex-team.ru>2022-02-10 16:47:47 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:47 +0300
commit73bb02f2495181e0719a800f979df508924f4b71 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /util/stream
parenteb3d925534734c808602b31b38b953677f0a279f (diff)
downloadydb-73bb02f2495181e0719a800f979df508924f4b71.tar.gz
Restoring authorship annotation for <sereglond@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r--util/stream/null.cpp14
-rw-r--r--util/stream/pipe.cpp18
-rw-r--r--util/stream/pipe.h12
3 files changed, 22 insertions, 22 deletions
diff --git a/util/stream/null.cpp b/util/stream/null.cpp
index 296f04866a..4e8b298145 100644
--- a/util/stream/null.cpp
+++ b/util/stream/null.cpp
@@ -13,8 +13,8 @@ TNullInput::~TNullInput() = default;
size_t TNullInput::DoRead(void*, size_t) {
return 0;
-}
-
+}
+
size_t TNullInput::DoSkip(size_t) {
return 0;
}
@@ -26,11 +26,11 @@ size_t TNullInput::DoNext(const void**, size_t) {
TNullOutput::TNullOutput() noexcept = default;
TNullOutput::~TNullOutput() = default;
-
+
void TNullOutput::DoWrite(const void* /*buf*/, size_t /*len*/) {
-}
-
+}
+
TNullIO::TNullIO() noexcept {
-}
-
+}
+
TNullIO::~TNullIO() = default;
diff --git a/util/stream/pipe.cpp b/util/stream/pipe.cpp
index b2a30144df..51be1934a7 100644
--- a/util/stream/pipe.cpp
+++ b/util/stream/pipe.cpp
@@ -40,9 +40,9 @@ TPipeBase::~TPipeBase() = default;
TPipeInput::TPipeInput(const TString& command)
: TPipeBase(command, "r")
-{
-}
-
+{
+}
+
size_t TPipeInput::DoRead(void* buf, size_t len) {
if (Impl_->Pipe_ == nullptr) {
return 0;
@@ -63,15 +63,15 @@ size_t TPipeInput::DoRead(void* buf, size_t len) {
TPipeOutput::TPipeOutput(const TString& command)
: TPipeBase(command, "w")
-{
-}
-
-void TPipeOutput::DoWrite(const void* buf, size_t len) {
+{
+}
+
+void TPipeOutput::DoWrite(const void* buf, size_t len) {
if (Impl_->Pipe_ == nullptr || len != ::fwrite(buf, 1, len, Impl_->Pipe_)) {
ythrow TSystemError() << "fwrite failed";
}
-}
-
+}
+
void TPipeOutput::Close() {
int exitStatus = ::pclose(Impl_->Pipe_);
Impl_->Pipe_ = nullptr;
diff --git a/util/stream/pipe.h b/util/stream/pipe.h
index e419af7966..18525b9517 100644
--- a/util/stream/pipe.h
+++ b/util/stream/pipe.h
@@ -15,7 +15,7 @@
/**
* Base class for starting a process and communicating with it via pipes.
*/
-class TPipeBase {
+class TPipeBase {
protected:
/**
* Starts a new process and opens a pipe.
@@ -26,12 +26,12 @@ protected:
*/
TPipeBase(const TString& command, const char* mode);
virtual ~TPipeBase();
-
+
protected:
class TImpl;
THolder<TImpl> Impl_;
-};
-
+};
+
/**
* Input stream that binds to a standard output stream of a newly started process.
*
@@ -49,7 +49,7 @@ public:
private:
size_t DoRead(void* buf, size_t len) override;
-};
+};
/**
* Output stream that binds to a standard input stream of a newly started process.
@@ -71,7 +71,7 @@ public:
* with a non-zero exit status.
*/
void Close();
-
+
private:
void DoWrite(const void* buf, size_t len) override;
};