Apache Log4cxx  Version 1.2.0
Loading...
Searching...
No Matches
log4cxx::helpers::CharMessageBuffer Class Reference

This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the message parameter. More...

#include <messagebuffer.h>

Public Member Functions

 CharMessageBuffer ()
 Creates a new instance.
 
 ~CharMessageBuffer ()
 Destructor.
 
CharMessageBufferoperator<< (const std::basic_string< char > &msg)
 Appends string to buffer.
 
CharMessageBufferoperator<< (const char *msg)
 Appends string to buffer.
 
CharMessageBufferoperator<< (char *msg)
 Appends string to buffer.
 
CharMessageBufferoperator<< (const char msg)
 Appends character to buffer.
 
CharMessageBufferoperator<< (const CFStringRef &msg)
 Appends a string into the buffer and fixes the buffer to use char characters.
 
std::ostream & operator<< (ios_base_manip manip)
 Insertion operator for STL manipulators such as std::fixed.
 
std::ostream & operator<< (bool val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (short val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (int val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (unsigned int val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (long val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (unsigned long val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (float val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (double val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (long double val)
 Insertion operator for built-in type.
 
std::ostream & operator<< (void *val)
 Insertion operator for built-in type.
 
 operator std::basic_ostream< char > & ()
 Cast to ostream.
 
std::basic_string< char > extract_str (std::basic_ostream< char > &os)
 Remove the constructed string.
 
std::basic_string< char > extract_str (CharMessageBuffer &buf)
 Remove the constructed string.
 
const std::basic_string< char > & str (std::basic_ostream< char > &os)
 Get content of buffer.
 
const std::basic_string< char > & str (CharMessageBuffer &buf)
 Get content of buffer.
 
bool hasStream () const
 Returns true if buffer has an encapsulated STL stream.
 

Detailed Description

This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the message parameter.

The class is not intended for use outside of that context.

Constructor & Destructor Documentation

◆ CharMessageBuffer()

log4cxx::helpers::CharMessageBuffer::CharMessageBuffer ( )

Creates a new instance.

◆ ~CharMessageBuffer()

log4cxx::helpers::CharMessageBuffer::~CharMessageBuffer ( )

Destructor.

Member Function Documentation

◆ extract_str() [1/2]

std::basic_string< char > log4cxx::helpers::CharMessageBuffer::extract_str ( CharMessageBuffer buf)

Remove the constructed string.

Parameters
bufused only to signal that the embedded stream was not used.

◆ extract_str() [2/2]

std::basic_string< char > log4cxx::helpers::CharMessageBuffer::extract_str ( std::basic_ostream< char > &  os)

Remove the constructed string.

Parameters
osused only to signal that the embedded stream was used.

◆ hasStream()

bool log4cxx::helpers::CharMessageBuffer::hasStream ( ) const

Returns true if buffer has an encapsulated STL stream.

Returns
true if STL stream was created.

◆ operator std::basic_ostream< char > &()

log4cxx::helpers::CharMessageBuffer::operator std::basic_ostream< char > & ( )

Cast to ostream.

◆ operator<<() [1/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( bool  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [2/16]

CharMessageBuffer & log4cxx::helpers::CharMessageBuffer::operator<< ( char *  msg)

Appends string to buffer.

Parameters
msgstring to append.
Returns
this buffer.

◆ operator<<() [3/16]

CharMessageBuffer & log4cxx::helpers::CharMessageBuffer::operator<< ( const CFStringRef msg)

Appends a string into the buffer and fixes the buffer to use char characters.

Parameters
msgmessage to append.
Returns
encapsulated CharMessageBuffer.

◆ operator<<() [4/16]

CharMessageBuffer & log4cxx::helpers::CharMessageBuffer::operator<< ( const char *  msg)

Appends string to buffer.

Parameters
msgstring to append.
Returns
this buffer.

◆ operator<<() [5/16]

CharMessageBuffer & log4cxx::helpers::CharMessageBuffer::operator<< ( const char  msg)

Appends character to buffer.

Parameters
msgcharacter to append.
Returns
this buffer.

◆ operator<<() [6/16]

CharMessageBuffer & log4cxx::helpers::CharMessageBuffer::operator<< ( const std::basic_string< char > &  msg)

Appends string to buffer.

Parameters
msgstring append.
Returns
this buffer.

◆ operator<<() [7/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( double  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [8/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( float  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [9/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( int  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [10/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( ios_base_manip  manip)

Insertion operator for STL manipulators such as std::fixed.

Parameters
manipmanipulator.
Returns
encapsulated STL stream.

◆ operator<<() [11/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( long double  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [12/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( long  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [13/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( short  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [14/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( unsigned int  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [15/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( unsigned long  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ operator<<() [16/16]

std::ostream & log4cxx::helpers::CharMessageBuffer::operator<< ( void *  val)

Insertion operator for built-in type.

Parameters
valbuild in type.
Returns
encapsulated STL stream.

◆ str() [1/2]

const std::basic_string< char > & log4cxx::helpers::CharMessageBuffer::str ( CharMessageBuffer buf)

Get content of buffer.

Parameters
bufused only to signal that the embedded stream was not used.

◆ str() [2/2]

const std::basic_string< char > & log4cxx::helpers::CharMessageBuffer::str ( std::basic_ostream< char > &  os)

Get content of buffer.

Parameters
osused only to signal that the embedded stream was used.

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