streamlet-examples/streamlet-common.h
branchv_0
changeset 75 ecbf6504915c
parent 69 52f837fbb216
child 95 f2f2b81079a5
equal deleted inserted replaced
74:a2aa84f310a5 75:ecbf6504915c
   144 
   144 
   145 		Option(std::wstring name, std::wstring value) : name(name), value(value) {
   145 		Option(std::wstring name, std::wstring value) : name(name), value(value) {
   146 		}
   146 		}
   147 	};
   147 	};
   148 
   148 
       
   149 private:
   149 	std::vector<std::wstring> versionsSupported;
   150 	std::vector<std::wstring> versionsSupported;
   150 	std::vector<AttributeMetadata> inputAttributes;
   151 	std::vector<AttributeMetadata> inputAttributes;
   151 	std::vector<std::wstring> outputAttributeAliases;
   152 	std::vector<std::wstring> outputAttributeAliases;
   152 	std::vector<Option> options;
   153 	std::vector<Option> options;
   153 	std::wstring currentRelation;
   154 	std::wstring currentRelation;
   154 	std::wstring currentFile;
   155 	std::wstring currentFile;
   155 
       
   156 	std::wstring_convert < std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings. Or use always UTF-8 for communication with subprocesses.
   156 	std::wstring_convert < std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings. Or use always UTF-8 for communication with subprocesses.
       
   157 
       
   158 protected:
       
   159 
       
   160 	/**
       
   161 	 * n.b. generic streamlet (later in relpipe-tr-streamler) will not have currentFile
       
   162 	 */
       
   163 	std::wstring getCurrentFile() {
       
   164 		return currentFile;
       
   165 	}
       
   166 
       
   167 	std::wstring getCurrentRelation() {
       
   168 		return currentRelation;
       
   169 	}
       
   170 
       
   171 	std::wstring fromBytes(std::string s) {
       
   172 		return convertor.from_bytes(s);
       
   173 	}
       
   174 
       
   175 	std::string toBytes(std::wstring s) {
       
   176 		return convertor.to_bytes(s);
       
   177 	}
   157 
   178 
   158 	static const std::wstring BOOLEAN;
   179 	static const std::wstring BOOLEAN;
   159 	static const std::wstring INTEGER;
   180 	static const std::wstring INTEGER;
   160 	static const std::wstring STRING;
   181 	static const std::wstring STRING;
   161 
   182