Hall-D Software
alpha
|
filter that add a time stamp on the begining of each line More...
#include <dater.h>
Public Member Functions | |
dater (std::streambuf *sb, const std::string &format="[%c] ", char separator='\n', bool write_first=true) | |
construct using another streambuf More... | |
~dater () | |
Protected Member Functions | |
std::streamsize | available () const |
remaining characters in the buffer More... | |
std::streamsize | taken () const |
number of characters in the buffer More... | |
Private Member Functions | |
void | write_date () |
writes the current date to the streambuf More... | |
int | sync () |
tries to write as much data as possible (overloaded from streambuf) More... | |
int | overflow (int c) |
write a character that surpasses buffer end (overloaded from streambuf) More... | |
std::streamsize | xsputn (const char *buffer, std::streamsize n) |
write an entire buffer (overloaded from streambuf) More... | |
Private Attributes | |
std::streambuf * | _sb |
posix::date_format | date |
char | separator |
bool | write_next |
xstream::dater::dater | ( | std::streambuf * | sb, |
const std::string & | format = "[%c] " , |
||
char | separator = '\n' , |
||
bool | write_first = true |
||
) |
construct using another streambuf
sb | streambuf to write data to |
format | format string for strftime defaults to [c] the preferred date and time representation for the current locale |
separator | character that signal a change of line, defaults to newline |
write_first | if true date is written right before the first write. default is true |
Definition at line 10 of file src/dater.cpp.
References LOG.
xstream::dater::~dater | ( | ) |
|
inlineprotectedinherited |
remaining characters in the buffer
Definition at line 28 of file common.h.
Referenced by xstream::base64::ostreambuf::~ostreambuf().
|
private |
write a character that surpasses buffer end (overloaded from streambuf)
Definition at line 21 of file src/dater.cpp.
References _sb, c, LOG, separator, write_date(), and write_next.
|
private |
tries to write as much data as possible (overloaded from streambuf)
Definition at line 16 of file src/dater.cpp.
|
inlineprotectedinherited |
number of characters in the buffer
Definition at line 36 of file common.h.
Referenced by xstream::digest::stream::xsputn().
|
private |
writes the current date to the streambuf
Definition at line 63 of file src/dater.cpp.
References _sb, date, LOG, xstream::posix::date_format::now(), string, and write_next.
Referenced by overflow(), and xsputn().
|
private |
write an entire buffer (overloaded from streambuf)
Definition at line 37 of file src/dater.cpp.
References _sb, LOG, separator, string, write_date(), and write_next.
|
private |
streambuf were data is written to
Definition at line 26 of file dater.h.
Referenced by overflow(), sync(), write_date(), xsputn(), and ~dater().
|
private |
Definition at line 27 of file dater.h.
Referenced by write_date().
|
private |
data is written after this character
Definition at line 28 of file dater.h.
Referenced by overflow(), and xsputn().
|
private |
Definition at line 29 of file dater.h.
Referenced by overflow(), write_date(), and xsputn().