
13 Feb
2012
13 Feb
'12
9:43 a.m.
On Mon, Feb 13, 2012 at 7:30 AM, Steven Samuel Cole <steven.samuel.cole@gmail.com> wrote:
class add_string_output_filter : public boost::iostreams::multichar_output_filter { public:
template<typename Sink> streamsize write(Sink& sink, const char* s, streamsize n) { string out_string = string(s);
Shouldn't that be string out_string(s, n);?
// remove trailing '\0' to prevent line break if (out_string[out_string.size()-1] = '\0') out_string = out_string.substr(0, out_string.size()-1);
I'd use out_string.erase(out_string.size() - 1); I've no experience with iostreams though, can't help you with the real problem. Olaf