Boost logo

Boost Users :

Subject: [Boost-users] [IOSTREAMS] Forcing a flush on newlines
From: David Larsson (laserallan_at_[hidden])
Date: 2009-06-29 09:45:59


Hi!
I'm outputting the progress from an externally executed command line
application using the windows API call OutputDebugString.
This means that I need to convert all line breaking characters to flush
commands to make sure the text is outputted when a new line is received
rather than when some underlying structure finds it suitable to linebreak.
I've created a sink that writes to OutputDebugString and it works great,
however unless I manually insert lots of std::endl (or flushing some other
way) I won't get any output until the buffer is full.

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?

/David



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