]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
g++ compilation fix after latest changes
[wxWidgets.git] / src / common / string.cpp
index 5729c48c65bdf035423de096875d19c46fa9846e..fcdca45d58a08aa3c98e32844a8293d93d144946 100644 (file)
@@ -168,7 +168,13 @@ static wxStrCacheStatsDumper s_showCacheStats;
 wxSTD ostream& operator<<(wxSTD ostream& os, const wxCStrData& str)
 {
 #if wxUSE_UNICODE && !wxUSE_UNICODE_UTF8
-    return os << (const char *)str.AsCharBuf();
+    const wxCharBuffer buf(str.AsCharBuf());
+    if ( !buf )
+        os.clear(wxSTD ios_base::failbit);
+    else
+        os << buf.data();
+
+    return os;
 #else
     return os << str.AsInternal();
 #endif
@@ -2090,48 +2096,3 @@ int wxString::Freq(wxUniChar ch) const
     }
     return count;
 }
-
-// ----------------------------------------------------------------------------
-// wxUTF8StringBuffer
-// ----------------------------------------------------------------------------
-
-#if wxUSE_UNICODE_WCHAR
-wxUTF8StringBuffer::~wxUTF8StringBuffer()
-{
-    wxMBConvStrictUTF8 conv;
-    size_t wlen = conv.ToWChar(NULL, 0, m_buf);
-    wxCHECK_RET( wlen != wxCONV_FAILED, "invalid UTF-8 data in string buffer?" );
-
-    wxStringInternalBuffer wbuf(m_str, wlen);
-    conv.ToWChar(wbuf, wlen, m_buf);
-}
-
-wxUTF8StringBufferLength::~wxUTF8StringBufferLength()
-{
-    wxCHECK_RET(m_lenSet, "length not set");
-
-    wxMBConvStrictUTF8 conv;
-    size_t wlen = conv.ToWChar(NULL, 0, m_buf, m_len);
-    wxCHECK_RET( wlen != wxCONV_FAILED, "invalid UTF-8 data in string buffer?" );
-
-    wxStringInternalBufferLength wbuf(m_str, wlen);
-    conv.ToWChar(wbuf, wlen, m_buf, m_len);
-    wbuf.SetLength(wlen);
-}
-#endif // wxUSE_UNICODE_WCHAR
-
-// ----------------------------------------------------------------------------
-// wxCharBufferType<T>
-// ----------------------------------------------------------------------------
-
-#ifndef __VMS_BROKEN_TEMPLATES
-template<>
-#endif
-wxCharTypeBuffer<char>::Data
-wxCharTypeBuffer<char>::NullData(NULL);
-
-#ifndef __VMS_BROKEN_TEMPLATES
-template<>
-#endif
-wxCharTypeBuffer<wchar_t>::Data
-wxCharTypeBuffer<wchar_t>::NullData(NULL);