Larry Evans wrote: > Larry Evans wrote: > > [snip] > >> Please see the just uploaded marg_ostreambuf.cpp for a >> little better version. > > > The just uploaded test_ostreambuf_decorator.zip contains > renamed classes as well as virtual {detach,attach}_ostream > to avoid using ostream* m_ostream==0 as flag indicating > the end of the chain of decorators.
The code mentioned MAY be very similar to that of J. Kanze available at:
http://www.gabi-soft.fr/code/Util/IO/FilteringOutputStream/gb/FilteringOutputStream.hh
I say this because in the comments to the code, in class:
class GB_FilteringOutputStreambufBase : public GB_iostd::streambuf
and after:
private: // insert : // --------
there's the following:
// Inserts a character into the destination. This is where // the actual filtering takes place. The function receives // the destination streambuf and the character as arguments; // in case of error, it should return EOF, otherwise, // anything else. Exactly what it does with the character is // upto the function in the derived class: it can pass it on // to the destination, simply drop it, send a dozen or so // other characters as well, or whatever it wants.
Since this is essentially what marg_ostreambuf does when it sees a '\n' character( i.e. it outputs the margin before the next output char) , I thought maybe this would be a better, more general, solution to the problem solved by marg_ostreambuf and marg_ostream in:
http://groups.yahoo.com/group/boost/files/col_io
What do other's think. Would J. Kanze be interested and have time to contribute this work to boost?
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost