remove obsolete DataTypeReaderCatalog.h v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 09 Sep 2018 22:47:18 +0200
branchv_0
changeset 23 25a53f4cd9eb
parent 22 e81019af67dc
child 24 6f7acc3b274c
remove obsolete DataTypeReaderCatalog.h
nbproject/configurations.xml
src/DataTypeReaderCatalog.h
--- 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