src/SubProcess.cpp
branchv_0
changeset 95 f2f2b81079a5
parent 62 a467e8cbd16b
equal deleted inserted replaced
94:b26e9b224fbe 95:f2f2b81079a5
    53 		for (char ch; subOutputReader.read(&ch, 1).good() && ch != SEPARATOR;) s.put(ch);
    53 		for (char ch; subOutputReader.read(&ch, 1).good() && ch != SEPARATOR;) s.put(ch);
    54 		return convertor.from_bytes(s.str());
    54 		return convertor.from_bytes(s.str());
    55 	}
    55 	}
    56 
    56 
    57 	void write(string_t s) {
    57 	void write(string_t s) {
       
    58 		// if the value contains a null byte 0x00, it will be trimmed (passing 0x00 through would break the protocol)
    58 		subInputWriter << convertor.to_bytes(s).c_str();
    59 		subInputWriter << convertor.to_bytes(s).c_str();
    59 		subInputWriter.put(SEPARATOR);
    60 		subInputWriter.put(SEPARATOR);
    60 		if (subInputWriter.bad()) throw SubProcess::Exception(L"Unable to write to sub-process.");
    61 		if (subInputWriter.bad()) throw SubProcess::Exception(L"Unable to write to sub-process.");
    61 	}
    62 	}
    62 
    63