Jonathan D. Turkanis wrote:
I've thought a little
more about composition, and I think I see what your getting at. Composing
streambufs is easy if the conversion facilities you want to use are
expressed as codecvts. A wrapper around the code I posted could be used to
generate streambufs like so:
template<typename Codecvt, typename SrcOrSink>
struct compose { }; // Derives from basic_streambuf<.., ..>
You could then chain this operation: compose<Compress, compose<Escape,
compose<Decrypt, File> > >. But the interface of std::codevt is complicated
by the need to make the member functions const and pass the state as an
The code in files/col_io/test_fwd_streambuf.zip shows another way.
The fwd_ostreambuf simply implements a linked list of streambuf*
each of which forwards the streambuf::overflow arg to the next
link in the chain.
The marg_ostreambuf in that zip file prototypes a simplification of
the marg_ostreambuf in the col_io.zip.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost