| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <Processors/Formats/IRowOutputFormat.h> |
| 4 | #include <Core/Block.h> |
| 5 | |
| 6 | |
| 7 | namespace DB |
| 8 | { |
| 9 | |
| 10 | class IColumn; |
| 11 | class IDataType; |
| 12 | class WriteBuffer; |
| 13 | |
| 14 | |
| 15 | /** A stream for outputting data in a binary line-by-line format. |
| 16 | */ |
| 17 | class BinaryRowOutputFormat: public IRowOutputFormat |
| 18 | { |
| 19 | public: |
| 20 | BinaryRowOutputFormat(WriteBuffer & out_, const Block & header, bool with_names_, bool with_types_, FormatFactory::WriteCallback callback); |
| 21 | |
| 22 | String getName() const override { return "BinaryRowOutputFormat"; } |
| 23 | |
| 24 | void writeField(const IColumn & column, const IDataType & type, size_t row_num) override; |
| 25 | void writePrefix() override; |
| 26 | |
| 27 | String getContentType() const override { return "application/octet-stream"; } |
| 28 | |
| 29 | protected: |
| 30 | bool with_names; |
| 31 | bool with_types; |
| 32 | }; |
| 33 | |
| 34 | } |
| 35 |