include/DataTypeWriter.h
author František Kučera <franta-hg@frantovo.cz>
Mon, 09 Jul 2018 00:43:35 +0200
branchv_0
changeset 2 1a574113da20
parent 1 DataTypeWriter.h@6e3494943c91
child 5 7fe870c3362f
permissions -rw-r--r--
separate 'src' and 'include' (public interface)

#pragma once

#include "DataTypeWriterBase.h"

namespace relpipe {
namespace writer {

template<typename T> class DataTypeWriter : public DataTypeWriterBase {
public:

	DataTypeWriter(const integer_t typeId, const string_t typeCode) : DataTypeWriterBase(typeId, typeCode) {
	}

	virtual ~DataTypeWriter() {
	};

	virtual T readValue(std::istream& input) = 0;

	virtual string_t readString(std::istream &input);

	virtual void writeValue(std::ostream& output, const T& value) = 0;

	virtual void writeString(std::ostream& output, const string_t &stringValue);

	virtual T toValue(const string_t &stringValue) = 0;
	virtual string_t toString(const T& value) = 0;

};

}
}