src/types/StringDataTypeWriter.h
branchv_0
changeset 15 8fd6c4d44071
parent 10 40ab091e5dfa
child 23 d505eaedc35e
equal deleted inserted replaced
14:733334eca89b 15:8fd6c4d44071
    24 private:
    24 private:
    25 	IntegerDataTypeWriter integerType;
    25 	IntegerDataTypeWriter integerType;
    26 	std::wstring_convert<std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings.
    26 	std::wstring_convert<std::codecvt_utf8<wchar_t>> convertor; // TODO: support also other encodings.
    27 public:
    27 public:
    28 
    28 
    29 	StringDataTypeWriter() : DataTypeWriter<string_t>(DATA_TYPE_ID_STRING, DATA_TYPE_CODE_STRING) {
    29 	StringDataTypeWriter() : DataTypeWriter<string_t>(TypeId::STRING, DATA_TYPE_CODE_STRING) {
    30 	}
    30 	}
    31 
    31 
    32 	void writeValue(std::ostream &output, const string_t &value) override {
    32 	void writeValue(std::ostream &output, const string_t &value) override {
    33 		std::string s = convertor.to_bytes(value);
    33 		std::string s = convertor.to_bytes(value);
    34 		integerType.writeValue(output, s.length());
    34 		integerType.writeValue(output, s.length());