18#ifndef _LOG4CXX_MESSAGE_BUFFER_H
19#define _LOG4CXX_MESSAGE_BUFFER_H
21#include <log4cxx/log4cxx.h>
32typedef std::ios_base& (*ios_base_manip)(std::ios_base&);
77#if LOG4CXX_CFSTRING_API
158 operator std::basic_ostream<char>& ();
165 std::basic_string<char>
extract_str(std::basic_ostream<char>& os);
179 const std::basic_string<char>&
str(std::basic_ostream<char>& os);
204 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(CharMessageBufferPrivate, m_priv)
210 return ((std::basic_ostream<char>&) os) << val;
214#if LOG4CXX_WCHAR_T_API
270 std::basic_ostream<wchar_t>&
operator<<(
bool val);
277 std::basic_ostream<wchar_t>&
operator<<(
short val);
283 std::basic_ostream<wchar_t>&
operator<<(
int val);
289 std::basic_ostream<wchar_t>&
operator<<(
unsigned int val);
295 std::basic_ostream<wchar_t>&
operator<<(
long val);
301 std::basic_ostream<wchar_t>&
operator<<(
unsigned long val);
307 std::basic_ostream<wchar_t>&
operator<<(
float val);
313 std::basic_ostream<wchar_t>&
operator<<(
double val);
319 std::basic_ostream<wchar_t>&
operator<<(
long double val);
325 std::basic_ostream<wchar_t>&
operator<<(
void* val);
331 operator std::basic_ostream<wchar_t>& ();
338 std::basic_string<wchar_t>
extract_str(std::basic_ostream<wchar_t>& os);
352 const std::basic_string<wchar_t>&
str(std::basic_ostream<wchar_t>& os);
377 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(WideMessageBufferPrivate, m_priv)
383 return ((std::basic_ostream<wchar_t>&) os) << val;
406 operator std::ostream& ();
468 const std::string&
str(std::ostream& os);
500#if LOG4CXX_CFSTRING_API
608 const std::wstring&
str(std::basic_ostream<wchar_t>& os);
627 LOG4CXX_DECLARE_PRIVATE_MEMBER_PTR(MessageBufferPrivate, m_priv)
633 return ((std::ostream&) os) << val;
636#if LOG4CXX_LOGCHAR_IS_UTF8
637 typedef CharMessageBuffer LogCharMessageBuffer;
640#if LOG4CXX_LOGCHAR_IS_WCHAR
641 typedef WideMessageBuffer LogCharMessageBuffer;
646typedef CharMessageBuffer MessageBuffer;
647typedef CharMessageBuffer LogCharMessageBuffer;
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition log4cxx/helpers/messagebuffer.h:40
CharMessageBuffer & operator<<(char *msg)
Appends string to buffer.
CharMessageBuffer & operator<<(const CFStringRef &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::ostream & operator<<(short val)
Insertion operator for built-in type.
std::ostream & operator<<(bool val)
Insertion operator for built-in type.
bool hasStream() const
Returns true if buffer has an encapsulated STL stream.
CharMessageBuffer & operator<<(const std::basic_string< char > &msg)
Appends string to buffer.
CharMessageBuffer()
Creates a new instance.
std::ostream & operator<<(float val)
Insertion operator for built-in type.
CharMessageBuffer & operator<<(const char *msg)
Appends string to buffer.
std::basic_string< char > extract_str(CharMessageBuffer &buf)
Remove the constructed string.
std::ostream & operator<<(ios_base_manip manip)
Insertion operator for STL manipulators such as std::fixed.
std::ostream & operator<<(long double val)
Insertion operator for built-in type.
std::ostream & operator<<(double val)
Insertion operator for built-in type.
CharMessageBuffer & operator<<(const char msg)
Appends character to buffer.
std::ostream & operator<<(unsigned long val)
Insertion operator for built-in type.
std::ostream & operator<<(int val)
Insertion operator for built-in type.
const std::basic_string< char > & str(CharMessageBuffer &buf)
Get content of buffer.
std::ostream & operator<<(long val)
Insertion operator for built-in type.
std::ostream & operator<<(void *val)
Insertion operator for built-in type.
std::basic_string< char > extract_str(std::basic_ostream< char > &os)
Remove the constructed string.
std::ostream & operator<<(unsigned int val)
Insertion operator for built-in type.
~CharMessageBuffer()
Destructor.
const std::basic_string< char > & str(std::basic_ostream< char > &os)
Get content of buffer.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition log4cxx/helpers/messagebuffer.h:392
const std::wstring & str(WideMessageBuffer &buf)
Get content of buffer.
WideMessageBuffer & operator<<(const wchar_t *msg)
Appends a string into the buffer and fixes the buffer to use char characters.
WideMessageBuffer & operator<<(wchar_t *msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::ostream & operator<<(short val)
Insertion operator for built-in type.
std::string extract_str(CharMessageBuffer &buf)
Remove the constructed string.
std::wstring extract_str(std::basic_ostream< wchar_t > &os)
Remove the constructed string.
bool hasStream() const
Returns true if buffer has an encapsulated STL stream.
WideMessageBuffer & operator<<(const wchar_t msg)
Appends a string into the buffer and fixes the buffer to use char characters.
CharMessageBuffer & operator<<(const char *msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::ostream & operator<<(float val)
Insertion operator for built-in type.
WideMessageBuffer & operator<<(const std::wstring &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::ostream & operator<<(unsigned long val)
Insertion operator for built-in type.
std::ostream & operator<<(long val)
Insertion operator for built-in type.
std::ostream & operator<<(unsigned int val)
Insertion operator for built-in type.
CharMessageBuffer & operator<<(char *msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::wstring extract_str(WideMessageBuffer &buf)
Remove the constructed string.
std::ostream & operator<<(double val)
Insertion operator for built-in type.
std::ostream & operator<<(long double val)
Insertion operator for built-in type.
MessageBuffer()
Creates a new instance.
std::ostream & operator<<(int val)
Insertion operator for built-in type.
std::ostream & operator<<(bool val)
Insertion operator for built-in type.
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
const std::string & str(std::ostream &os)
Get content of buffer.
std::ostream & operator<<(ios_base_manip manip)
Insertion operator for STL manipulators such as std::fixed.
~MessageBuffer()
Destructor.
std::ostream & operator<<(void *val)
Insertion operator for built-in type.
const std::wstring & str(std::basic_ostream< wchar_t > &os)
Get content of buffer.
CharMessageBuffer & operator<<(const std::string &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::string extract_str(std::ostream &os)
Remove the constructed string.
CharMessageBuffer & operator<<(const CFStringRef &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
CharMessageBuffer & operator<<(const char msg)
Appends a string into the buffer and fixes the buffer to use char characters.
This class is designed to support insertion operations in the message argument to the LOG4CXX_INFO an...
Definition log4cxx/helpers/messagebuffer.h:221
WideMessageBuffer & operator<<(const wchar_t *msg)
Appends string to buffer.
WideMessageBuffer()
Creates a new instance.
const std::basic_string< wchar_t > & str(WideMessageBuffer &buf)
Get content of buffer.
bool hasStream() const
Returns true if buffer has an encapsulated STL stream.
~WideMessageBuffer()
Destructor.
std::basic_string< wchar_t > extract_str(std::basic_ostream< wchar_t > &os)
Remove the constructed string.
std::basic_string< wchar_t > extract_str(WideMessageBuffer &buf)
Remove the constructed string.
WideMessageBuffer & operator<<(const wchar_t msg)
Appends character to buffer.
WideMessageBuffer & operator<<(const std::basic_string< wchar_t > &msg)
Appends string to buffer.
WideMessageBuffer & operator<<(wchar_t *msg)
Appends string to buffer.
const std::basic_string< wchar_t > & str(std::basic_ostream< wchar_t > &os)
Get content of buffer.
const struct __CFString * CFStringRef
Definition logstring.h:30
std::ios_base &(*) ios_base_manip(std::ios_base &)
Definition log4cxx/helpers/messagebuffer.h:32
std::basic_ostream< char > & operator<<(CharMessageBuffer &os, const V &val)
Definition log4cxx/helpers/messagebuffer.h:208