1 | #pragma once |
---|---|
2 | #include <DataStreams/IBlockOutputStream.h> |
3 | |
4 | namespace DB |
5 | { |
6 | |
7 | |
8 | class IOutputFormat; |
9 | |
10 | using OutputFormatPtr = std::shared_ptr<IOutputFormat>; |
11 | |
12 | class OutputStreamToOutputFormat : public IBlockOutputStream |
13 | { |
14 | public: |
15 | explicit OutputStreamToOutputFormat(OutputFormatPtr output_format_) : output_format(std::move(output_format_)) {} |
16 | |
17 | Block getHeader() const override; |
18 | |
19 | void write(const Block & block) override; |
20 | |
21 | void writePrefix() override; |
22 | void writeSuffix() override; |
23 | |
24 | void flush() override; |
25 | |
26 | void setRowsBeforeLimit(size_t rows_before_limit) override; |
27 | void setTotals(const Block & totals) override; |
28 | void setExtremes(const Block & extremes) override; |
29 | |
30 | void onProgress(const Progress & progress) override; |
31 | |
32 | std::string getContentType() const override; |
33 | |
34 | private: |
35 | OutputFormatPtr output_format; |
36 | }; |
37 | |
38 | } |
39 |