Implementation of streambuf for use by the Buffer's ostream. More...
#include <BufferStreambuf.hh>
Public Member Functions | |
ostreambuf () | |
Default constructor creates a new OutputBuffer. | |
ostreambuf (OutputBuffer &buffer) | |
Construct using an existing OutputBuffer. | |
const OutputBuffer & | getBuffer () const |
Return the buffer. | |
Protected Member Functions | |
virtual int_type | overflow (int_type c) |
Write a single character to the stream. | |
virtual std::streamsize | xsputn (const char_type *s, std::streamsize n) |
Write a block of characters to the stream. |
Implementation of streambuf for use by the Buffer's ostream.
This class derives from std::streambuf and implements the virtual functions needed to operate on OutputBuffer. The override functions are overflow and xsputn. Typically custom streambufs will also override sync for output, but we have no need since all writes are immediately stored in the buffer.