G
Guest
Hi, I wrote few filters working on streams of bytes, in example
enciption, UTF-8 decoding and such. Now I wonder how can I turn them
into classes derived from std::stream(?) or in other way to use them
with code working on std::stream std::ifsteam and such.
Keyword codecvc is probably related.
With "connecting to std:: streams/strings" I so far succeded in
std::string, I just wrote my own class of UnicodeChar (stored as full 32
bit) and made class UnicodeString derived from
std::basic_stream<UnicodeChar>, added operator<<(ostream that encodes to
Utf8 and so on...
But how to do simmilar thing for streams and stringstreams? Should I
only add
operator<<(ostringstream
and such - is it a good way to do it?
Or do std allow better way?
enciption, UTF-8 decoding and such. Now I wonder how can I turn them
into classes derived from std::stream(?) or in other way to use them
with code working on std::stream std::ifsteam and such.
Keyword codecvc is probably related.
With "connecting to std:: streams/strings" I so far succeded in
std::string, I just wrote my own class of UnicodeChar (stored as full 32
bit) and made class UnicodeString derived from
std::basic_stream<UnicodeChar>, added operator<<(ostream that encodes to
Utf8 and so on...
But how to do simmilar thing for streams and stringstreams? Should I
only add
operator<<(ostringstream
and such - is it a good way to do it?
Or do std allow better way?