src/StreamRelationalWriter.h
branchv_0
changeset 25 135ef93a4ac2
parent 23 d505eaedc35e
child 26 8ae93a43fed2
equal deleted inserted replaced
24:00fe696500c5 25:135ef93a4ac2
    23 private:
    23 private:
    24 	std::ostream &output;
    24 	std::ostream &output;
    25 	types::BooleanDataTypeWriter booleanWriter;
    25 	types::BooleanDataTypeWriter booleanWriter;
    26 	types::IntegerDataTypeWriter integerWriter;
    26 	types::IntegerDataTypeWriter integerWriter;
    27 	types::StringDataTypeWriter stringWriter;
    27 	types::StringDataTypeWriter stringWriter;
    28 	vector<DataTypeWriterBase*> writers = {&booleanWriter, &integerWriter, &stringWriter};
    28 	std::vector<DataTypeWriterBase*> writers = {&booleanWriter, &integerWriter, &stringWriter};
    29 
    29 
    30 	/**
    30 	/**
    31 	 * count of columns in the current table
    31 	 * count of columns in the current table
    32 	 */
    32 	 */
    33 	integer_t columnCount;
    33 	integer_t columnCount;
    37 	integer_t currentColumn;
    37 	integer_t currentColumn;
    38 
    38 
    39 	/**
    39 	/**
    40 	 * types of columns in the current table
    40 	 * types of columns in the current table
    41 	 */
    41 	 */
    42 	vector<TypeId> columnTypes;
    42 	std::vector<TypeId> columnTypes;
    43 
    43 
    44 	void writeString(const string_t &stringValue, const TypeId typeId) {
    44 	void writeString(const string_t &stringValue, const TypeId typeId) {
    45 		for (DataTypeWriterBase* writer : writers) if (writer->supports(typeId)) return writer->writeString(output, stringValue);
    45 		for (DataTypeWriterBase* writer : writers) if (writer->supports(typeId)) return writer->writeString(output, stringValue);
    46 		throw RelpipeWriterException(L"Unsupported data type: " + static_cast<integer_t> (typeId));
    46 		throw RelpipeWriterException(L"Unsupported data type: " + static_cast<integer_t> (typeId));
    47 	}
    47 	}