From: John Ky (newhoggy_at_[hidden])
Date: 2007-07-19 01:52:36
I have narrow stream buffers in the form:
I currently read and write to them via narrow streams:
I also have a function foo with wide character stream operators:
std::wostream &operater<<(std::wostream &, const foo &);
std::wistream &operater>>(std::wistream &, foo &);
I need a way to adapt my narrow request_stream and response_stream into wide
streams so that I can use my foo class stream operators.
I'm found the code_converter class which appears to do what I want but
examples are hard to come by.
I got something compiling, but I don't know if it is correct:
std::codecvt<wchar_t, char, mbstate_t> > char_to_wchar;
request_stream >> foo_object;
I also don't know how to do the reverse as the following doesn't compile at
response_stream << foo_object;
Anyone got any advice on this?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk