a stream's distributor: over the stream's own buffer while a sink is joined, the stream's own restored once the last one left - every write to each sink, a line's start prefixed by the writing thread's indent, a line sink given each line whole. Every distributor joins the stream's own buffer: the stream stays where it was, indented - a sink wanting the stream for itself leaves it (leave(*origin)). std::cout, std::clog and std::cerr get theirs at their first indent level or sink. A buffer joined twice is written once. Joining and leaving take the lock the writes take (io_mutex).
More...
#include <dx_redirect.h>
|
| static streambuf & | of (std::ostream &ostream) |
| | the stream's distributor: the one there is, or one kept for the process
|
| static bool | standard (const std::ostream &ostream) |
| | std::cout, std::clog or std::cerr: the streams living for the process, which an indent level gives a distributor
|
|
| std::string | dflt |
| std::streambuf *const | origin |
| | the stream's own buffer: stdout's, stderr's - std::clog's is stderr's too, there is no stdlog
|
|
| int_type | overflow (int_type ch=traits_type::eof()) override |
| int | sync () override |
| std::streamsize | xsputn (const char *data, std::streamsize count) override |
a stream's distributor: over the stream's own buffer while a sink is joined, the stream's own restored once the last one left - every write to each sink, a line's start prefixed by the writing thread's indent, a line sink given each line whole. Every distributor joins the stream's own buffer: the stream stays where it was, indented - a sink wanting the stream for itself leaves it (leave(*origin)). std::cout, std::clog and std::cerr get theirs at their first indent level or sink. A buffer joined twice is written once. Joining and leaving take the lock the writes take (io_mutex).
◆ streambuf()
| dx::redirect::indent::streambuf::streambuf |
( |
std::ostream & | ostream, |
|
|
const std::string & | dflt = indent::dflt::pattern ) |
|
inline |
◆ ~streambuf()
| dx::redirect::indent::streambuf::~streambuf |
( |
| ) |
|
|
inlineoverride |
◆ join()
| void dx::redirect::indent::streambuf::join |
( |
std::streambuf & | buffer, |
|
|
bool | line = false ) |
|
inline |
◆ leave()
| void dx::redirect::indent::streambuf::leave |
( |
std::streambuf & | buffer | ) |
|
|
inline |
◆ of()
| streambuf & dx::redirect::indent::streambuf::of |
( |
std::ostream & | ostream | ) |
|
|
inlinestatic |
the stream's distributor: the one there is, or one kept for the process
◆ operator<<()
| virtual streambuf & dx::redirect::indent::streambuf::operator<< |
( |
size_t | size | ) |
|
|
inlinevirtual |
◆ operator>>()
| virtual streambuf & dx::redirect::indent::streambuf::operator>> |
( |
const std::string & | indent | ) |
|
|
inlinevirtual |
◆ overflow()
| int_type dx::redirect::indent::streambuf::overflow |
( |
int_type | ch = traits_type::eof() | ) |
|
|
inlineoverrideprotected |
◆ standard()
| bool dx::redirect::indent::streambuf::standard |
( |
const std::ostream & | ostream | ) |
|
|
inlinestatic |
std::cout, std::clog or std::cerr: the streams living for the process, which an indent level gives a distributor
◆ sync()
| int dx::redirect::indent::streambuf::sync |
( |
| ) |
|
|
inlineoverrideprotected |
◆ xsputn()
| std::streamsize dx::redirect::indent::streambuf::xsputn |
( |
const char * | data, |
|
|
std::streamsize | count ) |
|
inlineoverrideprotected |
◆ join
◆ dflt
| std::string dx::redirect::indent::streambuf::dflt |
◆ origin
| std::streambuf* const dx::redirect::indent::streambuf::origin |
the stream's own buffer: stdout's, stderr's - std::clog's is stderr's too, there is no stdlog
The documentation for this class was generated from the following file: