ClickHouse/dbms/include/DB/DataStreams/TabSeparatedRowOutputStream.h
2011-08-09 19:19:00 +00:00

35 lines
643 B
C++

#pragma once
#include <Poco/SharedPtr.h>
#include <DB/IO/WriteBuffer.h>
#include <DB/DataTypes/IDataType.h>
#include <DB/DataStreams/IRowOutputStream.h>
namespace DB
{
using Poco::SharedPtr;
/** Интерфейс потока для вывода данных в формате tsv.
*/
class TabSeparatedRowOutputStream : public IRowOutputStream
{
public:
TabSeparatedRowOutputStream(WriteBuffer & ostr_, SharedPtr<DataTypes> data_types_);
void writeField(const Field & field);
void writeFieldDelimiter();
void writeRowEndDelimiter();
private:
WriteBuffer & ostr;
SharedPtr<DataTypes> data_types;
size_t field_number;
};
}