streamlet-examples/streamlet-common.h
branchv_0
changeset 75 ecbf6504915c
parent 69 52f837fbb216
child 95 f2f2b81079a5
--- a/streamlet-examples/streamlet-common.h	Wed Jan 29 20:50:12 2020 +0100
+++ b/streamlet-examples/streamlet-common.h	Thu Jan 30 14:19:14 2020 +0100
@@ -146,14 +146,35 @@
 		}
 	};
 
+private:
 	std::vector<std::wstring> versionsSupported;
 	std::vector<AttributeMetadata> inputAttributes;
 	std::vector<std::wstring> outputAttributeAliases;
 	std::vector<Option> options;
 	std::wstring currentRelation;
 	std::wstring currentFile;
+	std::wstring_convert < std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings. Or use always UTF-8 for communication with subprocesses.
 
-	std::wstring_convert < std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings. Or use always UTF-8 for communication with subprocesses.
+protected:
+
+	/**
+	 * n.b. generic streamlet (later in relpipe-tr-streamler) will not have currentFile
+	 */
+	std::wstring getCurrentFile() {
+		return currentFile;
+	}
+
+	std::wstring getCurrentRelation() {
+		return currentRelation;
+	}
+
+	std::wstring fromBytes(std::string s) {
+		return convertor.from_bytes(s);
+	}
+
+	std::string toBytes(std::wstring s) {
+		return convertor.to_bytes(s);
+	}
 
 	static const std::wstring BOOLEAN;
 	static const std::wstring INTEGER;