From 3ca1bf5add01419ba173f0567b060fdd9fd605f9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 11 Sep 2004 18:42:58 +0000 Subject: [PATCH] overload operator<<() for wchar_t too (if applicable/possible); this fixes the problem with << '\n' producing '10' on output git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29094 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/txtstrm.h | 3 +++ src/common/txtstrm.cpp | 9 +++++++++ 2 files changed, 12 insertions(+) diff --git a/include/wx/txtstrm.h b/include/wx/txtstrm.h index 83b2f5a002..8cbc1c747b 100644 --- a/include/wx/txtstrm.h +++ b/include/wx/txtstrm.h @@ -121,6 +121,9 @@ public: wxTextOutputStream& operator<<(const wxChar *string); wxTextOutputStream& operator<<(const wxString& string); wxTextOutputStream& operator<<(char c); +#if wxUSE_WCHAR_T && wxWCHAR_T_IS_REAL_TYPE + wxTextOutputStream& operator<<(wchar_t wc); +#endif // wxUSE_WCHAR_T wxTextOutputStream& operator<<(wxInt16 c); wxTextOutputStream& operator<<(wxInt32 c); wxTextOutputStream& operator<<(wxUint16 c); diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index 27b0b6c6ed..404f31f594 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -425,6 +425,15 @@ wxTextOutputStream& wxTextOutputStream::operator<<(char c) return *this; } +#if wxUSE_WCHAR_T && wxWCHAR_T_IS_REAL_TYPE + +wxTextOutputStream& wxTextOutputStream::operator<<(wchar_t wc) +{ + WriteString( wxString(&wc, m_conv, 1) ); +} + +#endif // wxUSE_WCHAR_T + wxTextOutputStream& wxTextOutputStream::operator<<(wxInt16 c) { wxString str;