ClickHouse/dbms/include/DB/DataStreams/TabSeparatedRowOutputStream.h

35 lines
643 B
C
Raw Normal View History

2011-08-09 19:19:00 +00:00
#pragma once
2010-03-04 19:20:28 +00:00
#include <Poco/SharedPtr.h>
2010-06-04 18:25:25 +00:00
#include <DB/IO/WriteBuffer.h>
2011-08-09 19:19:00 +00:00
#include <DB/DataTypes/IDataType.h>
2010-03-04 19:20:28 +00:00
#include <DB/DataStreams/IRowOutputStream.h>
namespace DB
{
using Poco::SharedPtr;
/** Интерфейс потока для вывода данных в формате tsv.
*/
class TabSeparatedRowOutputStream : public IRowOutputStream
{
public:
2010-06-04 18:25:25 +00:00
TabSeparatedRowOutputStream(WriteBuffer & ostr_, SharedPtr<DataTypes> data_types_);
2010-03-04 19:20:28 +00:00
void writeField(const Field & field);
void writeFieldDelimiter();
void writeRowEndDelimiter();
private:
2010-06-04 18:25:25 +00:00
WriteBuffer & ostr;
2010-03-05 17:38:01 +00:00
SharedPtr<DataTypes> data_types;
2010-03-04 19:20:28 +00:00
size_t field_number;
};
}