# HG changeset patch # User František Kučera # Date 1534188632 -7200 # Node ID 7fe3975f7e4bad07a4a38d7fd521551506bd7b78 # Parent 517888868e5563322cacf6a5d3e6051a0be0c44e relpipe-lib-reader: move public header files to: include/relpipe/reader/ diff -r 517888868e55 -r 7fe3975f7e4b include/DataTypeReader.h --- a/include/DataTypeReader.h Sun Jul 15 00:43:42 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -#pragma once - -#include "DataTypeReaderBase.h" - -namespace relpipe { -namespace reader { - -template 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 string_t toString(const T& value) = 0; - -}; - -} -} \ No newline at end of file diff -r 517888868e55 -r 7fe3975f7e4b include/DataTypeReaderBase.h --- a/include/DataTypeReaderBase.h Sun Jul 15 00:43:42 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -#pragma once - -#include -#include "typedefs.h" - -namespace relpipe { -namespace reader { - -/** - * 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 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 diff -r 517888868e55 -r 7fe3975f7e4b include/RelpipeReaderException.h --- a/include/RelpipeReaderException.h Sun Jul 15 00:43:42 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -#pragma once - -#include - -#include "typedefs.h" - -namespace relpipe { -namespace reader { - -class RelpipeReaderException { -private: - string_t message; -public: - - RelpipeReaderException(string_t message) : - message(message) { - } - - string_t getMessge() { - return message; - } - -}; - -} -} \ No newline at end of file diff -r 517888868e55 -r 7fe3975f7e4b include/relpipe/reader/DataTypeReader.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/relpipe/reader/DataTypeReader.h Mon Aug 13 21:30:32 2018 +0200 @@ -0,0 +1,26 @@ +#pragma once + +#include "DataTypeReaderBase.h" + +namespace relpipe { +namespace reader { + +template 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 string_t toString(const T& value) = 0; + +}; + +} +} \ No newline at end of file diff -r 517888868e55 -r 7fe3975f7e4b include/relpipe/reader/DataTypeReaderBase.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/relpipe/reader/DataTypeReaderBase.h Mon Aug 13 21:30:32 2018 +0200 @@ -0,0 +1,52 @@ +#pragma once + +#include +#include "typedefs.h" + +namespace relpipe { +namespace reader { + +/** + * 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 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 diff -r 517888868e55 -r 7fe3975f7e4b include/relpipe/reader/RelpipeReaderException.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/relpipe/reader/RelpipeReaderException.h Mon Aug 13 21:30:32 2018 +0200 @@ -0,0 +1,26 @@ +#pragma once + +#include + +#include "typedefs.h" + +namespace relpipe { +namespace reader { + +class RelpipeReaderException { +private: + string_t message; +public: + + RelpipeReaderException(string_t message) : + message(message) { + } + + string_t getMessge() { + return message; + } + +}; + +} +} \ No newline at end of file diff -r 517888868e55 -r 7fe3975f7e4b include/relpipe/reader/typedefs.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/relpipe/reader/typedefs.h Mon Aug 13 21:30:32 2018 +0200 @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +namespace relpipe { +namespace reader { + +using octet_t = uint8_t; +using integer_t = uint64_t; +using boolean_t = bool; +using string_t = std::wstring; + +} +} \ No newline at end of file diff -r 517888868e55 -r 7fe3975f7e4b include/typedefs.h --- a/include/typedefs.h Sun Jul 15 00:43:42 2018 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -#pragma once - -#include -#include - -namespace relpipe { -namespace reader { - -using octet_t = uint8_t; -using integer_t = uint64_t; -using boolean_t = bool; -using string_t = std::wstring; - -} -} \ No newline at end of file diff -r 517888868e55 -r 7fe3975f7e4b nbproject/configurations.xml --- a/nbproject/configurations.xml Sun Jul 15 00:43:42 2018 +0200 +++ b/nbproject/configurations.xml Mon Aug 13 21:30:32 2018 +0200 @@ -5,14 +5,14 @@ displayName="Header Files" projectFiles="true"> src/BooleanDataTypeReader.h - include/DataTypeReader.h - include/DataTypeReaderBase.h + include/relpipe/reader/DataTypeReader.h + include/relpipe/reader/DataTypeReaderBase.h src/DataTypeReaderCatalog.h src/IntegerDataTypeReader.h - include/RelpipeReaderException.h + include/relpipe/reader/RelpipeReaderException.h src/StringDataTypeReader.h src/format.h - include/typedefs.h + include/relpipe/reader/typedefs.h - - - + - + - + + + @@ -89,13 +98,22 @@ 5 - - - + - + - + + + diff -r 517888868e55 -r 7fe3975f7e4b src/DataTypeReader.cpp --- a/src/DataTypeReader.cpp Sun Jul 15 00:43:42 2018 +0200 +++ b/src/DataTypeReader.cpp Mon Aug 13 21:30:32 2018 +0200 @@ -1,4 +1,4 @@ -#include "../include/DataTypeReader.h" +#include "../include/relpipe/reader/DataTypeReader.h" namespace relpipe { namespace reader { diff -r 517888868e55 -r 7fe3975f7e4b src/DataTypeReaderBase.cpp --- a/src/DataTypeReaderBase.cpp Sun Jul 15 00:43:42 2018 +0200 +++ b/src/DataTypeReaderBase.cpp Mon Aug 13 21:30:32 2018 +0200 @@ -1,5 +1,5 @@ #include -#include "../include/DataTypeReaderBase.h" +#include "../include/relpipe/reader/DataTypeReaderBase.h" namespace relpipe { namespace reader {