relpipe-lib-writer: move public header files to: include/relpipe/writer/ v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 13 Aug 2018 20:30:55 +0200
branchv_0
changeset 20 bef6648e79b1
parent 19 98b901d7bb95
child 21 118b68d73420
relpipe-lib-writer: move public header files to: include/relpipe/writer/
include/Factory.h
include/RelationalWriter.h
include/RelpipeWriterException.h
include/TypeId.h
include/relpipe/writer/Factory.h
include/relpipe/writer/RelationalWriter.h
include/relpipe/writer/RelpipeWriterException.h
include/relpipe/writer/TypeId.h
include/relpipe/writer/typedefs.h
include/typedefs.h
nbproject/configurations.xml
src/DataTypeWriterBase.h
src/Factory.cpp
src/StreamRelationalWriter.h
src/format.h
src/types/BooleanDataTypeWriter.h
--- a/include/Factory.h	Sat Jul 28 15:42:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-#pragma once
-
-#include <string>
-#include <iostream>
-#include <vector>
-
-#include "typedefs.h"
-#include "TypeId.h"
-
-namespace relpipe {
-namespace writer {
-
-class Factory {
-public:
-	static RelationalWriter* create(std::ostream &output);
-};
-
-}
-}
--- a/include/RelationalWriter.h	Sat Jul 28 15:42:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-#pragma once
-
-#include <string>
-#include <iostream>
-#include <vector>
-
-#include "typedefs.h"
-#include "TypeId.h"
-
-namespace relpipe {
-namespace writer {
-
-class RelationalWriter {
-public:
-
-	virtual ~RelationalWriter() = default;
-
-	/**
-	 * @param typeCode string type code as defined in Specification
-	 * @return numeric id of given type
-	 * @throws RelpipeWriterException on unsupported typeCode
-	 */
-	virtual TypeId toTypeId(const string_t typeCode) = 0;
-
-	/**
-	 * @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;
-
-	/**
-	 * @param name name of the relation (table)
-	 * @param attributes list of attributes (columns) containing their names and types
-	 * @param writeHeader header might be omitted – when appending new records to a stream alreaready containing the header
-	 */
-	virtual void startRelation(string_t name, std::vector<std::pair<string_t, TypeId>> attributes, boolean_t writeHeader) = 0;
-
-	/**
-	 * Writes a single attribute.
-	 * @param value string representation of value of given attribute type as defined in Specification
-	 */
-	virtual void writeAttribute(const string_t& value) = 0;
-
-	// TODO: fluent interface?
-	// TODO: << operator?
-	// TODO: write bitmap + attribute:
-	// virtual void writeBitmap(...) = 0;
-	// virtual void writeAttribute(string_t attribute) = 0;
-
-	/**
-	 * Writes a single attribute.
-	 * @param value raw pointer to the value in format of given attribute type as defined in Specification
-	 * @param type used as a safety mechanism to avoid wrong pointer interpretation;
-	 * should be called in this way: writeAttribute(&value, typeid(value));
-	 * if the type does not match, the RelpipeWriterException is thrown
-	 */
-	virtual void writeAttribute(const void* value, const std::type_info& type) = 0;
-
-};
-
-}
-}
--- a/include/RelpipeWriterException.h	Sat Jul 28 15:42:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#pragma once
-
-#include <string>
-
-using namespace std;
-
-namespace relpipe {
-namespace writer {
-
-class RelpipeWriterException {
-private:
-	wstring message;
-public:
-
-	RelpipeWriterException(wstring message) :
-	message(message) {
-	}
-
-	wstring getMessge() {
-		return message;
-	}
-
-};
-
-}
-}
\ No newline at end of file
--- a/include/TypeId.h	Sat Jul 28 15:42:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-#pragma once
-
-namespace relpipe {
-namespace writer {
-
-enum class TypeId {
-	BOOLEAN = 1,
-	INTEGER = 2,
-	STRING = 3,
-};
-
-}
-}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/relpipe/writer/Factory.h	Mon Aug 13 20:30:55 2018 +0200
@@ -0,0 +1,19 @@
+#pragma once
+
+#include <string>
+#include <iostream>
+#include <vector>
+
+#include "typedefs.h"
+#include "TypeId.h"
+
+namespace relpipe {
+namespace writer {
+
+class Factory {
+public:
+	static RelationalWriter* create(std::ostream &output);
+};
+
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/relpipe/writer/RelationalWriter.h	Mon Aug 13 20:30:55 2018 +0200
@@ -0,0 +1,63 @@
+#pragma once
+
+#include <string>
+#include <iostream>
+#include <vector>
+
+#include "typedefs.h"
+#include "TypeId.h"
+
+namespace relpipe {
+namespace writer {
+
+class RelationalWriter {
+public:
+
+	virtual ~RelationalWriter() = default;
+
+	/**
+	 * @param typeCode string type code as defined in Specification
+	 * @return numeric id of given type
+	 * @throws RelpipeWriterException on unsupported typeCode
+	 */
+	virtual TypeId toTypeId(const string_t typeCode) = 0;
+
+	/**
+	 * @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;
+
+	/**
+	 * @param name name of the relation (table)
+	 * @param attributes list of attributes (columns) containing their names and types
+	 * @param writeHeader header might be omitted – when appending new records to a stream alreaready containing the header
+	 */
+	virtual void startRelation(string_t name, std::vector<std::pair<string_t, TypeId>> attributes, boolean_t writeHeader) = 0;
+
+	/**
+	 * Writes a single attribute.
+	 * @param value string representation of value of given attribute type as defined in Specification
+	 */
+	virtual void writeAttribute(const string_t& value) = 0;
+
+	// TODO: fluent interface?
+	// TODO: << operator?
+	// TODO: write bitmap + attribute:
+	// virtual void writeBitmap(...) = 0;
+	// virtual void writeAttribute(string_t attribute) = 0;
+
+	/**
+	 * Writes a single attribute.
+	 * @param value raw pointer to the value in format of given attribute type as defined in Specification
+	 * @param type used as a safety mechanism to avoid wrong pointer interpretation;
+	 * should be called in this way: writeAttribute(&value, typeid(value));
+	 * if the type does not match, the RelpipeWriterException is thrown
+	 */
+	virtual void writeAttribute(const void* value, const std::type_info& type) = 0;
+
+};
+
+}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/relpipe/writer/RelpipeWriterException.h	Mon Aug 13 20:30:55 2018 +0200
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <string>
+
+using namespace std;
+
+namespace relpipe {
+namespace writer {
+
+class RelpipeWriterException {
+private:
+	wstring message;
+public:
+
+	RelpipeWriterException(wstring message) :
+	message(message) {
+	}
+
+	wstring getMessge() {
+		return message;
+	}
+
+};
+
+}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/relpipe/writer/TypeId.h	Mon Aug 13 20:30:55 2018 +0200
@@ -0,0 +1,13 @@
+#pragma once
+
+namespace relpipe {
+namespace writer {
+
+enum class TypeId {
+	BOOLEAN = 1,
+	INTEGER = 2,
+	STRING = 3,
+};
+
+}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/relpipe/writer/typedefs.h	Mon Aug 13 20:30:55 2018 +0200
@@ -0,0 +1,15 @@
+#pragma once
+
+#include <cstdint>
+#include <string>
+
+namespace relpipe {
+namespace writer {
+
+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
--- a/include/typedefs.h	Sat Jul 28 15:42:33 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,15 +0,0 @@
-#pragma once
-
-#include <cstdint>
-#include <string>
-
-namespace relpipe {
-namespace writer {
-
-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
--- a/nbproject/configurations.xml	Sat Jul 28 15:42:33 2018 +0200
+++ b/nbproject/configurations.xml	Mon Aug 13 20:30:55 2018 +0200
@@ -7,15 +7,15 @@
       <itemPath>src/types/BooleanDataTypeWriter.h</itemPath>
       <itemPath>src/DataTypeWriter.h</itemPath>
       <itemPath>src/DataTypeWriterBase.h</itemPath>
-      <itemPath>include/Factory.h</itemPath>
+      <itemPath>include/relpipe/writer/Factory.h</itemPath>
       <itemPath>src/types/IntegerDataTypeWriter.h</itemPath>
-      <itemPath>include/RelationalWriter.h</itemPath>
-      <itemPath>include/RelpipeWriterException.h</itemPath>
+      <itemPath>include/relpipe/writer/RelationalWriter.h</itemPath>
+      <itemPath>include/relpipe/writer/RelpipeWriterException.h</itemPath>
       <itemPath>src/StreamRelationalWriter.h</itemPath>
       <itemPath>src/types/StringDataTypeWriter.h</itemPath>
-      <itemPath>include/TypeId.h</itemPath>
+      <itemPath>include/relpipe/writer/TypeId.h</itemPath>
       <itemPath>src/format.h</itemPath>
-      <itemPath>include/typedefs.h</itemPath>
+      <itemPath>include/relpipe/writer/typedefs.h</itemPath>
     </logicalFolder>
     <logicalFolder name="ResourceFiles"
                    displayName="Resource Files"
@@ -51,15 +51,21 @@
           <commandLine>-fsanitize=address</commandLine>
         </ccTool>
       </compileType>
-      <item path="include/Factory.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/Factory.h" ex="false" tool="3" flavor2="0">
       </item>
-      <item path="include/RelationalWriter.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/RelationalWriter.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
       </item>
-      <item path="include/RelpipeWriterException.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/RelpipeWriterException.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
       </item>
-      <item path="include/TypeId.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/TypeId.h" ex="false" tool="3" flavor2="0">
       </item>
-      <item path="include/typedefs.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/typedefs.h" ex="false" tool="3" flavor2="0">
       </item>
       <item path="src/DataTypeWriter.h" ex="false" tool="3" flavor2="0">
       </item>
@@ -98,15 +104,21 @@
           <developmentMode>5</developmentMode>
         </asmTool>
       </compileType>
-      <item path="include/Factory.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/Factory.h" ex="false" tool="3" flavor2="0">
       </item>
-      <item path="include/RelationalWriter.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/RelationalWriter.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
       </item>
-      <item path="include/RelpipeWriterException.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/RelpipeWriterException.h"
+            ex="false"
+            tool="3"
+            flavor2="0">
       </item>
-      <item path="include/TypeId.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/TypeId.h" ex="false" tool="3" flavor2="0">
       </item>
-      <item path="include/typedefs.h" ex="false" tool="3" flavor2="0">
+      <item path="include/relpipe/writer/typedefs.h" ex="false" tool="3" flavor2="0">
       </item>
       <item path="src/DataTypeWriter.h" ex="false" tool="3" flavor2="0">
       </item>
--- a/src/DataTypeWriterBase.h	Sat Jul 28 15:42:33 2018 +0200
+++ b/src/DataTypeWriterBase.h	Mon Aug 13 20:30:55 2018 +0200
@@ -1,7 +1,7 @@
 #pragma once
 
 #include <string>
-#include "../include/typedefs.h"
+#include "../include/relpipe/writer/typedefs.h"
 
 namespace relpipe {
 namespace writer {
--- a/src/Factory.cpp	Sat Jul 28 15:42:33 2018 +0200
+++ b/src/Factory.cpp	Mon Aug 13 20:30:55 2018 +0200
@@ -1,5 +1,5 @@
-#include "../include/RelationalWriter.h"
-#include "../include/Factory.h"
+#include "../include/relpipe/writer/RelationalWriter.h"
+#include "../include/relpipe/writer/Factory.h"
 #include "StreamRelationalWriter.h"
 
 namespace relpipe {
--- a/src/StreamRelationalWriter.h	Sat Jul 28 15:42:33 2018 +0200
+++ b/src/StreamRelationalWriter.h	Mon Aug 13 20:30:55 2018 +0200
@@ -4,9 +4,9 @@
 #include <iostream>
 #include <vector>
 
-#include "../include/typedefs.h"
-#include "../include/RelationalWriter.h"
-#include "../include/TypeId.h"
+#include "../include/relpipe/writer/typedefs.h"
+#include "../include/relpipe/writer/RelationalWriter.h"
+#include "../include/relpipe/writer/TypeId.h"
 #include "format.h"
 #include "DataTypeWriterBase.h"
 #include "types/BooleanDataTypeWriter.h"
--- a/src/format.h	Sat Jul 28 15:42:33 2018 +0200
+++ b/src/format.h	Mon Aug 13 20:30:55 2018 +0200
@@ -3,7 +3,7 @@
 #include <cstdint>
 #include <string>
 
-#include "../include/TypeId.h"
+#include "../include/relpipe/writer/TypeId.h"
 
 namespace relpipe {
 namespace writer {
--- a/src/types/BooleanDataTypeWriter.h	Sat Jul 28 15:42:33 2018 +0200
+++ b/src/types/BooleanDataTypeWriter.h	Mon Aug 13 20:30:55 2018 +0200
@@ -3,7 +3,7 @@
 #include <string>
 #include <iostream>
 
-#include "../../include/RelpipeWriterException.h"
+#include "../../include/relpipe/writer/RelpipeWriterException.h"
 #include "../DataTypeWriter.h"
 #include "../format.h"