rename writers to readers v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 14 Jul 2018 17:01:16 +0200
branchv_0
changeset 2 fc3a84a62dd9
parent 1 c80d55cdb42d
child 3 630c54da42c9
rename writers to readers
include/DataTypeReader.h
include/DataTypeReaderBase.h
include/DataTypeWriter.h
include/DataTypeWriterBase.h
src/DataTypeReader.cpp
src/DataTypeReaderBase.cpp
src/DataTypeWriter.cpp
src/DataTypeWriterBase.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/DataTypeReader.h	Sat Jul 14 17:01:16 2018 +0200
@@ -0,0 +1,31 @@
+#pragma once
+
+#include "DataTypeReaderBase.h"
+
+namespace relpipe {
+namespace writer {
+
+template<typename T> class DataTypeReader : public DataTypeReaderBase {
+public:
+
+	DataTypeReader(const integer_t typeId, const string_t typeCode) : DataTypeReaderBase(typeId, typeCode) {
+	}
+
+	virtual ~DataTypeReader() {
+	};
+
+	virtual T readValue(std::istream& input) = 0;
+
+	virtual string_t readString(std::istream &input);
+
+	virtual void writeValue(std::ostream& output, const T& value) = 0;
+
+	virtual void writeString(std::ostream& output, const string_t &stringValue);
+
+	virtual T toValue(const string_t &stringValue) = 0;
+	virtual string_t toString(const T& value) = 0;
+
+};
+
+}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/DataTypeReaderBase.h	Sat Jul 14 17:01:16 2018 +0200
@@ -0,0 +1,61 @@
+#pragma once
+
+#include <string>
+#include "typedefs.h"
+
+namespace relpipe {
+namespace writer {
+
+/**
+ * This class contains common features that are independent from particular data type (generic/template type)
+ */
+class DataTypeReaderBase {
+private:
+	const integer_t typeId;
+	const string_t typeCode;
+public:
+
+	DataTypeReaderBase(const integer_t typeId, const string_t typeCode) :
+	typeId(typeId), typeCode(typeCode) {
+	}
+
+	virtual ~DataTypeReaderBase() {
+	};
+
+	/**
+	 * @param input input stream, should be at position where the value is to be read; the stream will not be closed afred reading
+	 * @return read value in form of the string representation of given data type.
+	 * E.g. integer 123 is returned as a character string "123",
+	 * boolean true is returned as a character string "true".
+	 * See Relational pipes format specification for details.
+	 */
+	virtual string_t readString(std::istream &input) = 0;
+
+	/**
+	 * @param output output stream, should be at position where the value is to be written; the stream will not be closed not flushed after writing
+	 * @param stringValue write value as given data type (e.g. integer or boolean); stringValue parameter contains given value in string representation of given data type
+	 * E.g. integer 123 is passed as a character string "123"
+	 * boolean true is passed as a character string "true".
+	 * See Relational pipes format specification for details.
+	 */
+	virtual void writeString(std::ostream& output, const string_t &stringValue) = 0;
+
+	/**
+	 * @param dataType data type code as defined in DDP L0
+	 * @return whether this class supports conversions of this type
+	 */
+	virtual bool supports(const integer_t &dataType);
+
+	/**
+	 * @param dataType data type name as defined in DDP L0
+	 * @return whether this class supports conversions of this type
+	 */
+	virtual bool supports(const string_t &dataType);
+
+	integer_t getTypeId();
+
+	string_t getTypeCode();
+};
+
+}
+}
\ No newline at end of file
--- a/include/DataTypeWriter.h	Sat Jul 14 16:58:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#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 T readValue(std::istream& input) = 0;
-
-	virtual string_t readString(std::istream &input);
-
-	virtual void writeValue(std::ostream& output, const T& value) = 0;
-
-	virtual void writeString(std::ostream& output, const string_t &stringValue);
-
-	virtual T toValue(const string_t &stringValue) = 0;
-	virtual string_t toString(const T& value) = 0;
-
-};
-
-}
-}
\ No newline at end of file
--- a/include/DataTypeWriterBase.h	Sat Jul 14 16:58:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-#pragma once
-
-#include <string>
-#include "typedefs.h"
-
-namespace relpipe {
-namespace writer {
-
-/**
- * This class contains common features that are independent from particular data type (generic/template type)
- */
-class DataTypeWriterBase {
-private:
-	const integer_t typeId;
-	const string_t typeCode;
-public:
-
-	DataTypeWriterBase(const integer_t typeId, const string_t typeCode) :
-	typeId(typeId), typeCode(typeCode) {
-	}
-
-	virtual ~DataTypeWriterBase() {
-	};
-
-	/**
-	 * @param input input stream, should be at position where the value is to be read; the stream will not be closed afred reading
-	 * @return read value in form of the string representation of given data type.
-	 * E.g. integer 123 is returned as a character string "123",
-	 * boolean true is returned as a character string "true".
-	 * See Relational pipes format specification for details.
-	 */
-	virtual string_t readString(std::istream &input) = 0;
-
-	/**
-	 * @param output output stream, should be at position where the value is to be written; the stream will not be closed not flushed after writing
-	 * @param stringValue write value as given data type (e.g. integer or boolean); stringValue parameter contains given value in string representation of given data type
-	 * E.g. integer 123 is passed as a character string "123"
-	 * boolean true is passed as a character string "true".
-	 * See Relational pipes format specification for details.
-	 */
-	virtual void writeString(std::ostream& output, const string_t &stringValue) = 0;
-
-	/**
-	 * @param dataType data type code as defined in DDP L0
-	 * @return whether this class supports conversions of this type
-	 */
-	virtual bool supports(const integer_t &dataType);
-
-	/**
-	 * @param dataType data type name as defined in DDP L0
-	 * @return whether this class supports conversions of this type
-	 */
-	virtual bool supports(const string_t &dataType);
-
-	integer_t getTypeId();
-
-	string_t getTypeCode();
-};
-
-}
-}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/DataTypeReader.cpp	Sat Jul 14 17:01:16 2018 +0200
@@ -0,0 +1,15 @@
+#include "../include/DataTypeReader.h"
+
+namespace relpipe {
+namespace writer {
+
+template<typename T> string_t DataTypeReader<T>::readString(std::istream &input) {
+	return toString(readValue(input));
+};
+
+template<typename T> void DataTypeReader<T>::writeString(std::ostream& output, const string_t &stringValue) {
+	writeValue(output, toValue(stringValue));
+};
+
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/DataTypeReaderBase.cpp	Sat Jul 14 17:01:16 2018 +0200
@@ -0,0 +1,24 @@
+#include <string>
+#include "../include/DataTypeReaderBase.h"
+
+namespace relpipe {
+namespace writer {
+
+bool DataTypeReaderBase::supports(const integer_t &dataType) {
+	return dataType == typeId;
+}
+
+bool DataTypeReaderBase::supports(const string_t &dataType) {
+	return dataType == typeCode;
+}
+
+integer_t DataTypeReaderBase::getTypeId() {
+	return typeId;
+}
+
+string_t DataTypeReaderBase::getTypeCode() {
+	return typeCode;
+}
+
+}
+}
--- a/src/DataTypeWriter.cpp	Sat Jul 14 16:58:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#include "../include/DataTypeWriter.h"
-
-namespace relpipe {
-namespace writer {
-
-template<typename T> string_t DataTypeWriter<T>::readString(std::istream &input) {
-	return toString(readValue(input));
-};
-
-template<typename T> void DataTypeWriter<T>::writeString(std::ostream& output, const string_t &stringValue) {
-	writeValue(output, toValue(stringValue));
-};
-
-}
-}
--- a/src/DataTypeWriterBase.cpp	Sat Jul 14 16:58:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#include <string>
-#include "../include/DataTypeWriterBase.h"
-
-namespace relpipe {
-namespace writer {
-
-bool DataTypeWriterBase::supports(const integer_t &dataType) {
-	return dataType == typeId;
-}
-
-bool DataTypeWriterBase::supports(const string_t &dataType) {
-	return dataType == typeCode;
-}
-
-integer_t DataTypeWriterBase::getTypeId() {
-	return typeId;
-}
-
-string_t DataTypeWriterBase::getTypeCode() {
-	return typeCode;
-}
-
-}
-}