--- a/nbproject/configurations.xml Sun Sep 09 21:01:17 2018 +0200
+++ b/nbproject/configurations.xml Sun Sep 09 22:47:18 2018 +0200
@@ -8,7 +8,6 @@
<itemPath>src/types/BooleanDataTypeReader.h</itemPath>
<itemPath>src/DataTypeReader.h</itemPath>
<itemPath>src/DataTypeReaderBase.h</itemPath>
- <itemPath>src/DataTypeReaderCatalog.h</itemPath>
<itemPath>include/relpipe/reader/Factory.h</itemPath>
<itemPath>src/types/IntegerDataTypeReader.h</itemPath>
<itemPath>include/relpipe/reader/RelationalReader.h</itemPath>
@@ -100,8 +99,6 @@
</item>
<item path="src/DataTypeReaderBase.h" ex="false" tool="3" flavor2="0">
</item>
- <item path="src/DataTypeReaderCatalog.h" ex="false" tool="3" flavor2="0">
- </item>
<item path="src/Factory.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="src/StreamRelationalReader.h" ex="false" tool="3" flavor2="0">
@@ -178,8 +175,6 @@
</item>
<item path="src/DataTypeReaderBase.h" ex="false" tool="3" flavor2="0">
</item>
- <item path="src/DataTypeReaderCatalog.h" ex="false" tool="3" flavor2="0">
- </item>
<item path="src/Factory.cpp" ex="false" tool="1" flavor2="0">
</item>
<item path="src/StreamRelationalReader.h" ex="false" tool="3" flavor2="0">
--- a/src/DataTypeReaderCatalog.h Sun Sep 09 21:01:17 2018 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#pragma once
-
-#include <string>
-#include <iostream>
-#include <vector>
-
-#include "../include/typedefs.h"
-#include "../include/DataTypeReaderBase.h"
-#include "../include/RelpipeReaderException.h"
-
-#include "BooleanDataTypeReader.h"
-#include "IntegerDataTypeReader.h"
-#include "StringDataTypeReader.h"
-
-using namespace std;
-
-namespace relpipe {
-namespace reader {
-
-class DataTypeReaderCatalog {
-private:
- BooleanDataTypeReader booleanReader;
- IntegerDataTypeReader integerReader;
- StringDataTypeReader stringReader;
- vector<DataTypeReaderBase*> readers = {&booleanReader, &integerReader, &stringReader};
-public:
-
- integer_t toTypeId(const wstring typeCode) {
- for (DataTypeReaderBase* reader : readers) if (reader->supports(typeCode)) return reader->getTypeId();
- throw RelpipeReaderException(L"Unsupported data type: " + typeCode);
- }
-
- wstring toTypeCode(const integer_t typeId) {
- for (DataTypeReaderBase* reader : readers) if (reader->supports(typeId)) return reader->getTypeCode();
- throw RelpipeReaderException(L"Unsupported data type: " + typeId);
- }
-
- wstring readString(istream &input, const integer_t typeId) {
- for (DataTypeReaderBase* reader : readers) if (reader->supports(typeId)) return reader->readString(input);
- throw RelpipeReaderException(L"Unsupported data type: " + typeId);
- }
-
-};
-
-}
-}
\ No newline at end of file