C
Christopher Benson-Manica
Is there any way to prevent the streambuf from calling overflow or
xsputn unless I specifically flush the stream?
xsputn unless I specifically flush the stream?
Christopher Benson-Manica said:Is there any way to prevent the streambuf from calling overflow or
xsputn unless I specifically flush the stream?
John Harrison said:I can't think of any reasonable way to achieve that, but I could easily be
wrong. But I am sure it would be better to code this so that you don't much
care when overflow or xsputn is called. Why exactly does it matter?
Is your stream working now then? What was the problem? Before you were
complaining that overflow wasn't being called at all, not you are
complaining that its being called to often!
Christopher Benson-Manica said:Well, this is a deficiency of the class I'm trying to wrap -
TLSFile::Write() appends a '\n' to its argument before actually
writing to the file. So I have to code around it, convince my boss to
change that behavior (he seemed reluctant this morning), or just
forget wrapping the class with a stream at all.
Well, it kind of is. It turns out that the first time through the
section of code in question, nothing happens. On subsequent trips
through that section of code, however, things work as expected
(although not as I would want - see above). Does that sound like a
specific kind of mistake to you?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.