log4cpp  1.1
Public Types | Public Member Functions | Friends | List of all members
log4cpp::CategoryStream Class Reference

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...
 
 ~CategoryStream ()
 Destructor for CategoryStream. More...
 
CategorygetCategory () const
 Returns the destination Category for this stream. More...
 
Priority::Value getPriority () const throw ()
 Returns the priority for this stream. More...
 
void flush ()
 Flush the contents of the stream buffer to the Category and empties the buffer. More...
 
template<typename T >
CategoryStreamoperator<< (const T &t)
 Stream in arbitrary types and objects. More...
 
CategoryStreamoperator<< (const char *t)
 
template<typename T >
CategoryStreamoperator<< (const std::string &t)
 
std::streamsize width (std::streamsize wide)
 Set the width output on CategoryStream. More...
 
CategoryStreamoperator<< (cspf)
 

Friends

LOG4CPP_EXPORT friend CategoryStreameol (CategoryStream &os)
 eol manipulator More...
 
LOG4CPP_EXPORT friend CategoryStreamleft (CategoryStream &os)
 left manipulator More...
 

Detailed Description

This class enables streaming simple types and objects to a category.

Use category.errorStream(), etc. to obtain a CategoryStream class.

Member Typedef Documentation

◆ cspf

typedef CategoryStream&(* log4cpp::CategoryStream::cspf) (CategoryStream &)

Constructor & Destructor Documentation

◆ CategoryStream()

log4cpp::CategoryStream::CategoryStream ( Category category,
Priority::Value  priority 
)

Construct a CategoryStream for given Category with given priority.

Parameters
categoryThe category this stream will send log messages to.
priorityThe priority the log messages will get or Priority::NOTSET to silently discard any streamed in messages.

◆ ~CategoryStream()

log4cpp::CategoryStream::~CategoryStream ( )

Destructor for CategoryStream.

Member Function Documentation

◆ flush()

void log4cpp::CategoryStream::flush ( )

Flush the contents of the stream buffer to the Category and empties the buffer.

◆ getCategory()

Category& log4cpp::CategoryStream::getCategory ( ) const
inline

Returns the destination Category for this stream.

Returns
The Category.

◆ getPriority()

Priority::Value log4cpp::CategoryStream::getPriority ( ) const
throw (
)
inline

Returns the priority for this stream.

Returns
The priority.

◆ operator<<() [1/4]

template<typename T >
CategoryStream& log4cpp::CategoryStream::operator<< ( const T &  t)
inline

Stream in arbitrary types and objects.

Parameters
tThe value or object to stream in.
Returns
A reference to itself.

◆ operator<<() [2/4]

CategoryStream & log4cpp::CategoryStream::operator<< ( const char *  t)

◆ operator<<() [3/4]

template<typename T >
CategoryStream& log4cpp::CategoryStream::operator<< ( const std::string &  t)
inline

◆ operator<<() [4/4]

CategoryStream & log4cpp::CategoryStream::operator<< ( cspf  pf)

◆ width()

std::streamsize log4cpp::CategoryStream::width ( std::streamsize  wide)

Set the width output on CategoryStream.

Friends And Related Function Documentation

◆ eol

LOG4CPP_EXPORT friend CategoryStream& eol ( CategoryStream os)
friend

eol manipulator

◆ left

LOG4CPP_EXPORT friend CategoryStream& left ( CategoryStream os)
friend

left manipulator

Member Data Documentation

◆ _buffer

std::ostringstream* log4cpp::CategoryStream::_buffer

The documentation for this class was generated from the following files: