aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/pipe.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/stream/pipe.h
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/stream/pipe.h')
-rw-r--r--util/stream/pipe.h50
1 files changed, 25 insertions, 25 deletions
diff --git a/util/stream/pipe.h b/util/stream/pipe.h
index 3f501eb1b3e..18525b9517d 100644
--- a/util/stream/pipe.h
+++ b/util/stream/pipe.h
@@ -1,12 +1,12 @@
#pragma once
-
+
#include "input.h"
#include "output.h"
-
-#include <util/system/pipe.h>
+
+#include <util/system/pipe.h>
#include <util/generic/ptr.h>
#include <util/generic/string.h>
-
+
/**
* @addtogroup Streams_Pipes
* @{
@@ -16,7 +16,7 @@
* Base class for starting a process and communicating with it via pipes.
*/
class TPipeBase {
-protected:
+protected:
/**
* Starts a new process and opens a pipe.
*
@@ -27,9 +27,9 @@ protected:
TPipeBase(const TString& command, const char* mode);
virtual ~TPipeBase();
-protected:
- class TImpl;
- THolder<TImpl> Impl_;
+protected:
+ class TImpl;
+ THolder<TImpl> Impl_;
};
/**
@@ -38,8 +38,8 @@ protected:
* Note that if the process ends with non-zero exit status, `Read` function will
* throw an exception.
*/
-class TPipeInput: protected TPipeBase, public IInputStream {
-public:
+class TPipeInput: protected TPipeBase, public IInputStream {
+public:
/**
* Starts a new process and opens a pipe.
*
@@ -47,7 +47,7 @@ public:
*/
TPipeInput(const TString& command);
-private:
+private:
size_t DoRead(void* buf, size_t len) override;
};
@@ -57,8 +57,8 @@ private:
* Note that if the process ends with non-zero exit status, `Close` function will
* throw an exception.
*/
-class TPipeOutput: protected TPipeBase, public IOutputStream {
-public:
+class TPipeOutput: protected TPipeBase, public IOutputStream {
+public:
/**
* Starts a new process and opens a pipe.
*
@@ -70,30 +70,30 @@ public:
* Waits for the process to terminate and throws an exception if it ended
* with a non-zero exit status.
*/
- void Close();
+ void Close();
-private:
+private:
void DoWrite(const void* buf, size_t len) override;
};
class TPipedBase {
-protected:
- TPipedBase(PIPEHANDLE fd);
+protected:
+ TPipedBase(PIPEHANDLE fd);
virtual ~TPipedBase();
-protected:
- TPipeHandle Handle_;
+protected:
+ TPipeHandle Handle_;
};
/**
* Input stream that binds to a standard output stream of an existing process.
*/
class TPipedInput: public TPipedBase, public IInputStream {
-public:
- TPipedInput(PIPEHANDLE fd);
+public:
+ TPipedInput(PIPEHANDLE fd);
~TPipedInput() override;
-private:
+private:
size_t DoRead(void* buf, size_t len) override;
};
@@ -101,11 +101,11 @@ private:
* Output stream that binds to a standard input stream of an existing process.
*/
class TPipedOutput: public TPipedBase, public IOutputStream {
-public:
- TPipedOutput(PIPEHANDLE fd);
+public:
+ TPipedOutput(PIPEHANDLE fd);
~TPipedOutput() override;
-private:
+private:
void DoWrite(const void* buf, size_t len) override;
};