mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
40 lines
935 B
C++
40 lines
935 B
C++
#pragma once
|
|
#include <DataStreams/IBlockOutputStream.h>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
|
|
class IOutputFormat;
|
|
|
|
using OutputFormatPtr = std::shared_ptr<IOutputFormat>;
|
|
|
|
/// Wrapper. Implements IBlockOutputStream interface using IOutputFormat object.
|
|
class OutputStreamToOutputFormat : public IBlockOutputStream
|
|
{
|
|
public:
|
|
explicit OutputStreamToOutputFormat(OutputFormatPtr output_format_) : output_format(std::move(output_format_)) {}
|
|
|
|
Block getHeader() const override;
|
|
|
|
void write(const Block & block) override;
|
|
|
|
void writePrefix() override;
|
|
void writeSuffix() override;
|
|
|
|
void flush() override;
|
|
|
|
void setRowsBeforeLimit(size_t rows_before_limit) override;
|
|
void setTotals(const Block & totals) override;
|
|
void setExtremes(const Block & extremes) override;
|
|
|
|
void onProgress(const Progress & progress) override;
|
|
|
|
std::string getContentType() const override;
|
|
|
|
private:
|
|
OutputFormatPtr output_format;
|
|
};
|
|
|
|
}
|