18 #ifndef _LOG4CXX_MESSAGE_BUFFER_H
19 #define _LOG4CXX_MESSAGE_BUFFER_H
21 #include <log4cxx/log4cxx.h>
26 #pragma warning ( push )
27 #pragma warning ( disable: 4251 4275 )
39 typedef std::ios_base& (*ios_base_manip)(std::ios_base&);
156 operator std::basic_ostream<char>& ();
163 const std::basic_string<char>&
str(std::basic_ostream<char>& os);
191 std::basic_string<char> buf;
195 std::basic_ostringstream<char>* stream;
201 return ((std::basic_ostream<char>&) os) << val;
204 #if LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API || LOG4CXX_LOGCHAR_IS_UNICHAR
251 #if LOG4CXX_CFSTRING_API
368 std::basic_string<UniChar> buf;
372 std::basic_ostringstream<UniChar>* stream;
382 #if LOG4CXX_WCHAR_T_API
438 std::basic_ostream<wchar_t>&
operator<<(
bool val);
445 std::basic_ostream<wchar_t>&
operator<<(
short val);
451 std::basic_ostream<wchar_t>&
operator<<(
int val);
457 std::basic_ostream<wchar_t>&
operator<<(
unsigned int val);
463 std::basic_ostream<wchar_t>&
operator<<(
long val);
469 std::basic_ostream<wchar_t>&
operator<<(
unsigned long val);
475 std::basic_ostream<wchar_t>&
operator<<(
float val);
481 std::basic_ostream<wchar_t>&
operator<<(
double val);
487 std::basic_ostream<wchar_t>&
operator<<(
long double val);
493 std::basic_ostream<wchar_t>&
operator<<(
void* val);
499 operator std::basic_ostream<wchar_t>& ();
506 const std::basic_string<wchar_t>&
str(std::basic_ostream<wchar_t>& os);
534 std::basic_string<wchar_t> buf;
538 std::basic_ostringstream<wchar_t>* stream;
544 return ((std::basic_ostream<wchar_t>&) os) << val;
567 operator std::ostream& ();
613 const std::string&
str(std::ostream& os);
644 #if LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API
675 #if LOG4CXX_CFSTRING_API
767 const std::wstring&
str(std::basic_ostream<wchar_t>& os);
769 #if LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API
812 #if LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API
823 return ((std::ostream&) os) << val;
826 #if LOG4CXX_LOGCHAR_IS_UTF8
827 typedef CharMessageBuffer LogCharMessageBuffer;
830 #if LOG4CXX_LOGCHAR_IS_WCHAR
831 typedef WideMessageBuffer LogCharMessageBuffer;
834 #if LOG4CXX_LOGCHAR_IS_UNICHAR
835 typedef UniCharMessageBuffer LogCharMessageBuffer;
839 typedef CharMessageBuffer MessageBuffer;
840 typedef CharMessageBuffer LogCharMessageBuffer;
846 #if defined(_MSC_VER)
847 #pragma warning (pop)
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:47
CharMessageBuffer & operator<<(const char msg)
Appends character to buffer.
bool hasStream() const
Returns true if buffer has an encapsulated STL stream.
std::ostream & operator<<(ios_base_manip manip)
Insertion operator for STL manipulators such as std::fixed.
const std::basic_string< char > & str(CharMessageBuffer &buf)
Get content of buffer.
const std::basic_string< char > & str(std::basic_ostream< char > &os)
Get content of buffer.
CharMessageBuffer & operator<<(char *msg)
Appends string to buffer.
std::ostream & operator<<(short val)
Insertion operator for built-in type.
CharMessageBuffer()
Creates a new instance.
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<<(double val)
Insertion operator for built-in type.
std::ostream & operator<<(void *val)
Insertion operator for built-in type.
std::ostream & operator<<(long double val)
Insertion operator for built-in type.
std::ostream & operator<<(int val)
Insertion operator for built-in type.
CharMessageBuffer & operator<<(const std::basic_string< char > &msg)
Appends string to buffer.
CharMessageBuffer & operator<<(const char *msg)
Appends string to buffer.
std::ostream & operator<<(bool val)
Insertion operator for built-in type.
std::ostream & operator<<(float val)
Insertion operator for built-in type.
~CharMessageBuffer()
Destructor.
This class is used by the LOG4CXX_INFO and similar macros to support insertion operators in the messa...
Definition: messagebuffer.h:553
CharMessageBuffer & operator<<(const char *msg)
Appends a string into the buffer and fixes the buffer to use char characters.
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<<(double val)
Insertion operator for built-in type.
std::ostream & operator<<(long val)
Insertion operator for built-in type.
CharMessageBuffer & operator<<(const std::string &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
const std::wstring & str(std::basic_ostream< wchar_t > &os)
Get content of buffer.
WideMessageBuffer & operator<<(const wchar_t msg)
Appends a string into the buffer and fixes the buffer to use char characters.
bool hasStream() const
Returns true if buffer has an encapsulated STL stream.
std::ostream & operator<<(int val)
Insertion operator for built-in type.
std::ostream & operator<<(void *val)
Insertion operator for built-in type.
std::ostream & operator<<(ios_base_manip manip)
Insertion operator for STL manipulators such as std::fixed.
std::ostream & operator<<(unsigned long val)
Insertion operator for built-in type.
CharMessageBuffer & operator<<(const char msg)
Appends a string into the buffer and fixes the buffer to use char characters.
const std::wstring & str(WideMessageBuffer &buf)
Get content of buffer.
std::ostream & operator<<(short val)
Insertion operator for built-in type.
std::ostream & operator<<(long double val)
Insertion operator for built-in type.
UniCharMessageBuffer & operator<<(UniChar *msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::ostream & operator<<(unsigned int val)
Insertion operator for built-in type.
UniCharMessageBuffer & operator<<(const UniChar *msg)
Appends a string into the buffer and fixes the buffer to use char characters.
UniCharMessageBuffer & operator<<(const UniChar msg)
Appends a string into the buffer and fixes the buffer to use char characters.
MessageBuffer()
Creates a new instance.
WideMessageBuffer & operator<<(const std::wstring &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
std::ostream & operator<<(bool 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.
UniCharMessageBuffer & operator<<(const std::basic_string< UniChar > &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
~MessageBuffer()
Destructor.
UniCharMessageBuffer & operator<<(const CFStringRef &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
const std::string & str(std::ostream &os)
Get content of buffer.
const std::basic_string< UniChar > & str(UniCharMessageBuffer &buf)
Get content of buffer.
std::ostream & operator<<(float val)
Insertion operator for built-in type.
const std::basic_string< UniChar > & str(UniCharMessageBuffer::uostream &os)
Get content of buffer.
const std::string & str(CharMessageBuffer &buf)
Get content of buffer.
This class is designed to support insertion operations in the message argument to the LOG4CXX_INFO an...
Definition: messagebuffer.h:211
const std::basic_string< UniChar > & str(uostream &os)
Get content of buffer.
UniCharMessageBuffer & operator<<(UniChar *msg)
Appends string to buffer.
uostream & operator<<(short val)
Insertion operator for built-in type.
const std::basic_string< UniChar > & str(UniCharMessageBuffer &buf)
Get content of buffer.
std::basic_ostream< UniChar > uostream
Definition: messagebuffer.h:222
uostream & operator<<(unsigned int val)
Insertion operator for built-in type.
UniCharMessageBuffer()
Creates a new instance.
UniCharMessageBuffer & operator<<(const UniChar msg)
Appends character to buffer.
uostream & operator<<(long val)
Insertion operator for built-in type.
uostream & operator<<(int val)
Insertion operator for built-in type.
UniCharMessageBuffer & operator<<(const CFStringRef &msg)
Appends a string into the buffer and fixes the buffer to use char characters.
uostream & operator<<(void *val)
Insertion operator for built-in type.
uostream & operator<<(float val)
Insertion operator for built-in type.
uostream & operator<<(unsigned long val)
Insertion operator for built-in type.
uostream & operator<<(double val)
Insertion operator for built-in type.
uostream & operator<<(long double val)
Insertion operator for built-in type.
UniCharMessageBuffer & operator<<(const std::basic_string< UniChar > &msg)
Appends string to buffer.
uostream & operator<<(bool val)
Insertion operator for built-in type.
UniCharMessageBuffer & operator<<(const UniChar *msg)
Appends string to buffer.
uostream & operator<<(ios_base_manip manip)
Insertion operator for STL manipulators such as std::fixed.
bool hasStream() const
Returns true if buffer has an encapsulated STL stream.
~UniCharMessageBuffer()
Destructor.
This class is designed to support insertion operations in the message argument to the LOG4CXX_INFO an...
Definition: messagebuffer.h:389
WideMessageBuffer()
Creates a new instance.
WideMessageBuffer & operator<<(const wchar_t *msg)
Appends string to buffer.
WideMessageBuffer & operator<<(wchar_t *msg)
Appends string to buffer.
bool hasStream() const
Returns true if buffer has an encapsulated STL stream.
~WideMessageBuffer()
Destructor.
const std::basic_string< wchar_t > & str(WideMessageBuffer &buf)
Get content of buffer.
const std::basic_string< wchar_t > & str(std::basic_ostream< wchar_t > &os)
Get content of buffer.
WideMessageBuffer & operator<<(const std::basic_string< wchar_t > &msg)
Appends string to buffer.
WideMessageBuffer & operator<<(const wchar_t msg)
Appends character to buffer.
const struct __CFString * CFStringRef
Definition: logstring.h:36
std::ios_base &(* ios_base_manip)(std::ios_base &)
Definition: messagebuffer.h:39
void MessageBufferUseStaticStream()
std::basic_ostream< char > & operator<<(CharMessageBuffer &os, const V &val)
Definition: messagebuffer.h:199
Definition: appender.h:33
unsigned short UniChar
Definition: logstring.h:44