--- 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;