16 LOG(
"tee::ostreambuf::add (streambuf*)");
21 LOG(
"tee::ostreambuf::add (ostream&)");
26 LOG(
"tee::ostreambuf::remove (streambuf*)");
31 LOG(
"tee::ostreambuf::remove (ostream&)");
36 LOG(
"tee::ostreambuf::sync");
41 std::map<std::streambuf*, int> return_code;
43 std::set<std::streambuf*>::iterator it =
destinations.begin();
45 int ret = (*it)->pubsync();
46 return_code[*it] = ret;
54 if (
eof == return_code[*it]) {
67 LOG(
"tee::ostreambuf::overflow " << c);
73 std::map<std::streambuf*, int> return_code;
75 std::set<std::streambuf*>::iterator it =
destinations.begin();
77 int ret = (*it)->sputc(c);
78 return_code[*it] = ret;
86 if (
eof==return_code[*it]) {
99 LOG(
"tee::ostreambuf::xsputn " << buffer);
105 std::map<std::streambuf*, int> return_code;
107 std::set<std::streambuf*>::iterator it =
destinations.begin();
109 int ret = (*it)->sputn(buffer,n);
110 return_code[*it] = ret;
118 if (0 > return_code[*it]) {
std::set< std::streambuf * > destinations
debugging/logging support
int sync()
flush as much data as possible (overloaded from streambuf)
C++ streambuf to fork output data written to it is also written to several other streambufs.
~ostreambuf()
closes the streambuf stream
void add(std::streambuf *sb)
add an output streembuf to write to
void remove(std::streambuf *sb)
remove a streambuf to write to
std::streamsize xsputn(const char *buffer, std::streamsize n)
write an entire buffer (overloaded from streambuf)
int overflow(int c)
write a character that supasses buffer end (overloaded from streambuf)