Implements Filter interface for filterstreambuf. More...
Public Member Functions | |
LogFilter (const std::string &path, const std::string &prefix) | |
Constructor. | |
LogFilter (std::ostream &stream, const std::string &prefix) | |
Constructor, stream is managed by client. | |
~LogFilter () | |
Destructor. | |
int | put (int c) |
Output a character. | |
int | get () |
Input a character, always fails. | |
int | sync () |
Flush buffers. | |
void | close () |
This is a noop. | |
void | prefix (const std::string &prefix) |
Set prefix that will be printer at the start of each output line. | |
const std::string & | prefix () const |
std::ios::iostate | state () const |
Private Attributes | |
bool | owner_ |
std::string | buf_ |
std::string | prefix_ |
std::ostream * | stream_ |
bool | lastnl_ |
Implements Filter interface for filterstreambuf.
Definition at line 34 of file logstream.h.
Dv::Util::logstream::LogFilter::LogFilter | ( | const std::string & | path, | |
const std::string & | prefix | |||
) |
Constructor.
path | name of file on which log will be written. | |
prefix,: | each output line will start with the current date and the prefix string |
Dv::Util::logstream::LogFilter::LogFilter | ( | std::ostream & | stream, | |
const std::string & | prefix | |||
) |
Constructor, stream is managed by client.
stream | open output stream on which log will be written. | |
prefix,: | each output line will start with the current date and the prefix string |
Dv::Util::logstream::LogFilter::~LogFilter | ( | ) |
Destructor.
int Dv::Util::logstream::LogFilter::put | ( | int | c | ) |
Output a character.
c | char to output |
int Dv::Util::logstream::LogFilter::get | ( | ) | [inline] |
Input a character, always fails.
Definition at line 61 of file logstream.h.
int Dv::Util::logstream::LogFilter::sync | ( | ) |
Flush buffers.
void Dv::Util::logstream::LogFilter::close | ( | ) | [inline] |
This is a noop.
Definition at line 69 of file logstream.h.
void Dv::Util::logstream::LogFilter::prefix | ( | const std::string & | prefix | ) | [inline] |
Set prefix that will be printer at the start of each output line.
Definition at line 73 of file logstream.h.
References prefix_.
Referenced by Dv::Util::logstream::prefix().
const std::string& Dv::Util::logstream::LogFilter::prefix | ( | ) | const [inline] |
Definition at line 78 of file logstream.h.
References prefix_.
std::ios::iostate Dv::Util::logstream::LogFilter::state | ( | ) | const |
bool Dv::Util::logstream::LogFilter::owner_ [private] |
Definition at line 84 of file logstream.h.
std::string Dv::Util::logstream::LogFilter::buf_ [private] |
Definition at line 85 of file logstream.h.
std::string Dv::Util::logstream::LogFilter::prefix_ [private] |
Definition at line 86 of file logstream.h.
Referenced by prefix().
std::ostream* Dv::Util::logstream::LogFilter::stream_ [private] |
Definition at line 87 of file logstream.h.
bool Dv::Util::logstream::LogFilter::lastnl_ [private] |
Definition at line 88 of file logstream.h.
dvutil-1.0.10 | [ 5 December, 2009] |