aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream/length.h
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/stream/length.h
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/stream/length.h')
-rw-r--r--util/stream/length.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/util/stream/length.h b/util/stream/length.h
index 4d508ae24d..9ee60ae203 100644
--- a/util/stream/length.h
+++ b/util/stream/length.h
@@ -1,10 +1,10 @@
#pragma once
-
-#include "input.h"
+
+#include "input.h"
#include "output.h"
-
-#include <util/generic/utility.h>
-
+
+#include <util/generic/utility.h>
+
/**
* Proxy input stream that can read a limited number of characters from a slave
* stream.
@@ -15,35 +15,35 @@
class TLengthLimitedInput: public IInputStream {
public:
inline TLengthLimitedInput(IInputStream* slave, ui64 length) noexcept
- : Slave_(slave)
- , Length_(length)
- {
+ : Slave_(slave)
+ , Length_(length)
+ {
}
-
+
~TLengthLimitedInput() override = default;
-
+
inline ui64 Left() const noexcept {
return Length_;
}
-
+
private:
size_t DoRead(void* buf, size_t len) override;
size_t DoSkip(size_t len) override;
-
+
private:
IInputStream* Slave_;
ui64 Length_;
};
-
+
/**
* Proxy input stream that counts the number of characters read.
*/
class TCountingInput: public IInputStream {
public:
inline TCountingInput(IInputStream* slave) noexcept
- : Slave_(slave)
- , Count_()
- {
+ : Slave_(slave)
+ , Count_()
+ {
}
~TCountingInput() override = default;
@@ -65,7 +65,7 @@ private:
private:
IInputStream* Slave_;
ui64 Count_;
-};
+};
/**
* Proxy output stream that counts the number of characters written.
@@ -73,9 +73,9 @@ private:
class TCountingOutput: public IOutputStream {
public:
inline TCountingOutput(IOutputStream* slave) noexcept
- : Slave_(slave)
- , Count_()
- {
+ : Slave_(slave)
+ , Count_()
+ {
}
~TCountingOutput() override = default;