aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/streams/growing_file_input/growing_file_input.h
diff options
context:
space:
mode:
authorvitalyisaev <vitalyisaev@ydb.tech>2023-11-30 13:26:22 +0300
committervitalyisaev <vitalyisaev@ydb.tech>2023-11-30 15:44:45 +0300
commit0a98fece5a9b54f16afeb3a94b3eb3105e9c3962 (patch)
tree291d72dbd7e9865399f668c84d11ed86fb190bbf /library/cpp/streams/growing_file_input/growing_file_input.h
parentcb2c8d75065e5b3c47094067cb4aa407d4813298 (diff)
downloadydb-0a98fece5a9b54f16afeb3a94b3eb3105e9c3962.tar.gz
YQ Connector:Use docker-compose in integrational tests
Diffstat (limited to 'library/cpp/streams/growing_file_input/growing_file_input.h')
-rw-r--r--library/cpp/streams/growing_file_input/growing_file_input.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/library/cpp/streams/growing_file_input/growing_file_input.h b/library/cpp/streams/growing_file_input/growing_file_input.h
new file mode 100644
index 0000000000..9054a5f3da
--- /dev/null
+++ b/library/cpp/streams/growing_file_input/growing_file_input.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include <util/stream/input.h>
+#include <util/system/file.h>
+
+/**
+ * Growing file input stream.
+ *
+ * File descriptor offsets to the end of the file, when the object is created.
+ *
+ * Read function waites for reading at least one byte.
+ */
+class TGrowingFileInput: public IInputStream {
+public:
+ TGrowingFileInput(const TFile& file);
+ TGrowingFileInput(const TString& path);
+
+private:
+ size_t DoRead(void* buf, size_t len) override;
+
+private:
+ TFile File_;
+};