|
libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
|
A std::streambuf that writes every byte to two underlying buffers. More...
#include <tee_stream.hpp>
Public Member Functions | |
| TeeBuf (std::streambuf *buf1, std::streambuf *buf2) | |
| Construct a TeeBuf that mirrors output to buf1 and buf2. | |
Protected Member Functions | |
| virtual int | overflow (int c) override |
| Write a single character to both buffers. | |
| virtual int | sync () override |
| Flush both underlying buffers. | |
Private Attributes | |
| std::streambuf * | buf1 = nullptr |
| First sink. | |
| std::streambuf * | buf2 = nullptr |
| Second sink. | |
A std::streambuf that writes every byte to two underlying buffers.
Attach two std::streambuf pointers at construction. Any character written through this buffer is forwarded to both sinks; overflow() and sync() are both propagated.
Definition at line 28 of file tee_stream.hpp.
|
inline |
|
inlineoverrideprotectedvirtual |
Write a single character to both buffers.
| c | Character to write (may be EOF). |
Definition at line 43 of file tee_stream.hpp.
|
inlineoverrideprotectedvirtual |
Flush both underlying buffers.
Definition at line 68 of file tee_stream.hpp.
Referenced by overflow().
|
private |
First sink.
Definition at line 78 of file tee_stream.hpp.
Referenced by overflow(), sync(), and TeeBuf().
|
private |
Second sink.
Definition at line 79 of file tee_stream.hpp.
Referenced by overflow(), sync(), and TeeBuf().