Boost logo

Boost Users :

Subject: Re: [Boost-users] [IOSTREAMS] Forcing a flush on newlines
From: Roland Bock (rbock_at_[hidden])
Date: 2009-06-30 03:37:17


David Larsson wrote:
> Is it possible to write an iostream filter that forces a flush on
> newlines or is this something I need to handle before feeding data into
> my stream?

Hi,

such a filter should work. I did not actually test it, but I inserted a

boost::iostream::flush(sink);

to one of my output filters and it compiles. Code is attached.

Regards,

Roland

PS: The whole class is not very well tested, since we always use its
input filter equivalent, but it should give you a start...




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net