Boost logo

Boost :

From: Larry Evans (jcampbell3_at_[hidden])
Date: 2003-06-15 08:31:31

Larry Evans wrote:
> Larry Evans wrote:
> [snip]
>> Please see the just uploaded marg_ostreambuf.cpp for a
>> little better version.
> The just uploaded 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

I say this because in the comments to the code, in class:

   class GB_FilteringOutputStreambufBase : public GB_iostd::streambuf

and after:

     // 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:

What do other's think. Would J. Kanze be interested and have time to
contribute this work to boost?

Boost list run by bdawes at, gregod at, cpdaniel at, john at