remove toTypeCode() (is needed only in lib-reader) v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 03 Sep 2018 23:41:29 +0200
branchv_0
changeset 26 8ae93a43fed2
parent 25 135ef93a4ac2
child 27 a64afb2d24c9
remove toTypeCode() (is needed only in lib-reader)
include/relpipe/writer/RelationalWriter.h
src/StreamRelationalWriter.h
--- a/include/relpipe/writer/RelationalWriter.h	Sat Aug 25 18:21:09 2018 +0200
+++ b/include/relpipe/writer/RelationalWriter.h	Mon Sep 03 23:41:29 2018 +0200
@@ -22,15 +22,6 @@
 	virtual TypeId toTypeId(const string_t typeCode) = 0;
 
 	/**
-	 * TODO: not needed for writing → move to lib-reader.
-	 * 
-	 * @param typeId numeric type id as defined in Specification
-	 * @return string code of given type
-	 * @throws RelpipeWriterException on unsupported typeId
-	 */
-	virtual string_t toTypeCode(const TypeId typeId) = 0;
-
-	/**
 	 * TODO: use custom extensible class instead of std::pair 
 	 * 
 	 * @param name name of the relation (table)
--- a/src/StreamRelationalWriter.h	Sat Aug 25 18:21:09 2018 +0200
+++ b/src/StreamRelationalWriter.h	Mon Sep 03 23:41:29 2018 +0200
@@ -62,11 +62,6 @@
 		throw RelpipeWriterException(L"Unsupported data type: " + typeCode);
 	}
 
-	string_t toTypeCode(const TypeId typeId) override {
-		for (DataTypeWriterBase* writer : writers) if (writer->supports(typeId)) return writer->getTypeCode();
-		throw RelpipeWriterException(L"Unsupported data type: " + static_cast<integer_t> (typeId));
-	}
-
 	void startRelation(string_t name, std::vector<std::pair<string_t, TypeId> > attributes, boolean_t writeHeader) override {
 		string_t tableName = name;
 		columnCount = attributes.size();