X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a6d14383a57771a334f6d0b6376dd47bf24049d..1154f91b6a4590d4fda9e4cef75aa4ff35ca57bc:/include/wx/ustring.h diff --git a/include/wx/ustring.h b/include/wx/ustring.h index 1158af5a98..03f3493e87 100644 --- a/include/wx/ustring.h +++ b/include/wx/ustring.h @@ -1,4 +1,4 @@ -///////////////////////////////////////////////////////////////////////////// + // Name: wx/ustring.h // Purpose: 32-bit string (UCS-4) // Author: Robert Roebling @@ -13,50 +13,21 @@ #include "wx/defs.h" #include "wx/string.h" -WXDLLIMPEXP_TEMPLATE_INSTANCE_BASE( wxCharTypeBuffer ) +#include #if SIZEOF_WCHAR_T == 2 - typedef wxWCharBuffer wxU16CharBuffer; - #else - -class WXDLLIMPEXP_BASE wxU16CharBuffer : public wxCharTypeBuffer -{ -public: - typedef wxCharTypeBuffer wxCharTypeBufferBase; - - wxU16CharBuffer(const wxCharTypeBufferBase& buf) - : wxCharTypeBufferBase(buf) {} - - wxU16CharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} - wxU16CharBuffer(size_t len) : wxCharTypeBufferBase(len) {} -}; - +typedef wxCharTypeBuffer wxU16CharBuffer; #endif - - -#if SIZEOF_WCHAR_T == 2 - -class WXDLLIMPEXP_BASE wxU32CharBuffer : public wxCharTypeBuffer -{ -public: - typedef wxCharTypeBuffer wxCharTypeBufferBase; - - wxU32CharBuffer(const wxCharTypeBufferBase& buf) - : wxCharTypeBufferBase(buf) {} - - wxU32CharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} - wxU32CharBuffer(size_t len) : wxCharTypeBufferBase(len) {} -}; - -#else - +#if SIZEOF_WCHAR_T == 4 typedef wxWCharBuffer wxU32CharBuffer; - +#else +typedef wxCharTypeBuffer wxU32CharBuffer; #endif + class WXDLLIMPEXP_BASE wxUString: public std::basic_string { public: @@ -185,7 +156,7 @@ public: return utf16_str(); } #else - wchar_t* wx_str() + const wchar_t* wx_str() { return c_str(); } @@ -676,7 +647,7 @@ inline bool operator==(const wxUString& s1, const wxUString& s2) inline bool operator!=(const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) != 0; } inline bool operator< (const wxUString& s1, const wxUString& s2) - { wxPrintf( "test\n"); return s1.compare( s2 ) < 0; } + { return s1.compare( s2 ) < 0; } inline bool operator> (const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) > 0; } inline bool operator<=(const wxUString& s1, const wxUString& s2)