1 | #pragma once |
---|---|
2 | |
3 | #include <iostream> |
4 | |
5 | #include <IO/WriteBuffer.h> |
6 | #include <IO/BufferWithOwnMemory.h> |
7 | |
8 | |
9 | namespace DB |
10 | { |
11 | |
12 | class WriteBufferFromOStream : public BufferWithOwnMemory<WriteBuffer> |
13 | { |
14 | protected: |
15 | std::ostream * ostr{}; |
16 | |
17 | void nextImpl() override; |
18 | |
19 | WriteBufferFromOStream(size_t size = DBMS_DEFAULT_BUFFER_SIZE, char * existing_memory = nullptr, size_t alignment = 0); |
20 | |
21 | public: |
22 | WriteBufferFromOStream( |
23 | std::ostream & ostr_, |
24 | size_t size = DBMS_DEFAULT_BUFFER_SIZE, |
25 | char * existing_memory = nullptr, |
26 | size_t alignment = 0); |
27 | |
28 | ~WriteBufferFromOStream() override; |
29 | }; |
30 | |
31 | } |
32 |