src/DataTypeWriter.h
branchv_0
changeset 9 0a40752e401d
parent 5 7fe870c3362f
child 15 8fd6c4d44071
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/DataTypeWriter.h	Sat Jul 21 17:30:25 2018 +0200
@@ -0,0 +1,28 @@
+#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 void writeValue(std::ostream& output, const T& value) = 0;
+
+	void writeString(std::ostream& output, const string_t &stringValue) override {
+		writeValue(output, toValue(stringValue));
+	}
+
+	virtual T toValue(const string_t &stringValue) = 0;
+
+};
+
+}
+}
\ No newline at end of file