This class enables streaming simple types and objects to a category. More...
#include <CategoryStream.hh>
Public Types | |
| typedef CategoryStream &(* | cspf) (CategoryStream &) |
Public Member Functions | |
| CategoryStream (Category &category, Priority::Value priority) | |
| Construct a CategoryStream for given Category with given priority. More... | |
| void | flush () |
| Flush the contents of the stream buffer to the Category and empties the buffer. More... | |
| Category & | getCategory () const |
| Returns the destination Category for this stream. More... | |
| Priority::Value | getPriority () const throw () |
| Returns the priority for this stream. More... | |
| template<typename T > | |
| CategoryStream & | operator<< (const T &t) |
| Stream in arbitrary types and objects. More... | |
| CategoryStream & | operator<< (const char *t) |
| template<typename T > | |
| CategoryStream & | operator<< (const std::string &t) |
| CategoryStream & | operator<< (cspf) |
| std::streamsize | width (std::streamsize wide) |
| Set the width output on CategoryStream. More... | |
| ~CategoryStream () | |
| Destructor for CategoryStream. More... | |
Private Member Functions | |
| CategoryStream & | operator= (const CategoryStream &) |
Private Attributes | |
| union { | |
| std::ostringstream * _buffer | |
| }; | |
| Category & | _category |
| Priority::Value | _priority |
Friends | |
| LOG4CPP_EXPORT friend CategoryStream & | eol (CategoryStream &os) |
| eol manipulator More... | |
| LOG4CPP_EXPORT friend CategoryStream & | left (CategoryStream &os) |
| left manipulator More... | |
This class enables streaming simple types and objects to a category.
Use category.errorStream(), etc. to obtain a CategoryStream class.
Definition at line 39 of file CategoryStream.hh.
| typedef CategoryStream&(* CategoryStream::cspf) (CategoryStream &) |
Definition at line 137 of file CategoryStream.hh.
| CategoryStream::CategoryStream | ( | Category & | category, |
| Priority::Value | priority | ||
| ) |
Construct a CategoryStream for given Category with given priority.
| category | The category this stream will send log messages to. |
| priority | The priority the log messages will get or Priority::NOTSET to silently discard any streamed in messages. |
| CategoryStream::~CategoryStream | ( | ) |
Destructor for CategoryStream.
| void CategoryStream::flush | ( | ) |
Flush the contents of the stream buffer to the Category and empties the buffer.
|
inline |
Returns the destination Category for this stream.
Definition at line 59 of file CategoryStream.hh.
|
inline | |||||||||||||
Returns the priority for this stream.
Definition at line 65 of file CategoryStream.hh.
|
inline |
Stream in arbitrary types and objects.
| t | The value or object to stream in. |
Definition at line 80 of file CategoryStream.hh.
| CategoryStream& CategoryStream::operator<< | ( | const char * | t | ) |
|
inline |
Definition at line 95 of file CategoryStream.hh.
| CategoryStream& CategoryStream::operator<< | ( | cspf | ) |
|
private |
| std::streamsize CategoryStream::width | ( | std::streamsize | wide | ) |
Set the width output on CategoryStream.
|
friend |
eol manipulator
|
friend |
left manipulator
| union { ... } |
| std::ostringstream* CategoryStream::_buffer |
Definition at line 130 of file CategoryStream.hh.
|
private |
Definition at line 127 of file CategoryStream.hh.
|
private |
Definition at line 128 of file CategoryStream.hh.