The tee_buffer_t type provides a stream buffer that allows output to multiple targets.
More...
|
void | add_buffer (std::string key, std::streambuf *sb, bool colorized) |
| Add a buffer to which output should be written.
|
|
void | disable_buffer (std::string key) |
| Disable a buffer so that output is not written to it.
|
|
void | enable_buffer (std::string key) |
| Enable a buffer so that output is written to it.
|
|
|
virtual int | overflow (int c) |
| Override the overflow method.
|
|
virtual int | sync () |
| Override the sync method so that we sync all of the output buffers.
|
|
The tee_buffer_t type provides a stream buffer that allows output to multiple targets.
◆ add_buffer()
void add_buffer |
( |
std::string | key, |
|
|
std::streambuf * | sb, |
|
|
bool | colorized ) |
Add a buffer to which output should be written.
This also enables the buffer,i.e., output will be written to it. For a given key, only the first call to this method will have an effect.
◆ enable_buffer()
void enable_buffer |
( |
std::string | key | ) |
|
Enable a buffer so that output is written to it.
This is mainly for buffers that have been disabled and need to be re-enabled.
◆ disable_buffer()
void disable_buffer |
( |
std::string | key | ) |
|
Disable a buffer so that output is not written to it.
◆ overflow()
virtual int overflow |
( |
int | c | ) |
|
|
protectedvirtual |
Override the overflow method.
This streambuf has no buffer, so overflow happens for every character that is written to the string, allowing us to write to multiple output streams. This method also detects colorization strings embedded in the character stream and removes them from output that is going to non-colorized buffers.
- Parameters
-
c | The character to write. This is passed in as an int so that non-characters like EOF can be written to the stream. |
◆ sync()
Override the sync method so that we sync all of the output buffers.