src/DataTypeWriterCatalog.h
branchv_0
changeset 9 0a40752e401d
parent 8 03750aff8619
child 10 40ab091e5dfa
--- a/src/DataTypeWriterCatalog.h	Sun Jul 15 00:45:21 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-#pragma once
-
-#include <string>
-#include <iostream>
-#include <vector>
-
-#include "../include/typedefs.h"
-#include "../include/DataTypeWriterBase.h"
-#include "BooleanDataTypeWriter.h"
-#include "IntegerDataTypeWriter.h"
-#include "StringDataTypeWriter.h"
-
-namespace relpipe {
-namespace writer {
-
-class DataTypeCatalog {
-private:
-	BooleanDataTypeWriter booleanWriter;
-	IntegerDataTypeWriter integerWriter;
-	StringDataTypeWriter stringWriter;
-	vector<DataTypeWriterBase*> writers = {&booleanWriter, &integerWriter, &stringWriter};
-public:
-
-	integer_t toTypeId(const string_t typeCode) {
-		for (DataTypeWriterBase* writer : writers) if (writer->supports(typeCode)) return writer->getTypeId();
-		throw RelpipeWriterException(L"Unsupported data type: " + typeCode);
-	}
-
-	string_t toTypeCode(const integer_t typeId) {
-		for (DataTypeWriterBase* writer : writers) if (writer->supports(typeId)) return writer->getTypeCode();
-		throw RelpipeWriterException(L"Unsupported data type: " + typeId);
-	}
-
-	void writeString(std::ostream &output, const string_t &stringValue, const integer_t typeId) {
-		for (DataTypeWriterBase* writer : writers) if (writer->supports(typeId)) return writer->writeString(output, stringValue);
-		throw RelpipeWriterException(L"Unsupported data type: " + typeId);
-	}
-
-};
-
-}
-}
\ No newline at end of file