X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb330c2ec30fc5aca5ce0a885530d4d09b351a1d..0995b9dc18a7ce898c1c1be0e2790b258cab0fee:/include/wx/ustring.h?ds=sidebyside diff --git a/include/wx/ustring.h b/include/wx/ustring.h index e12c1dfeac..5b0d377e74 100644 --- a/include/wx/ustring.h +++ b/include/wx/ustring.h @@ -45,7 +45,6 @@ public: wxUString() { } wxUString( const wxChar32 *str ) { assign(str); } - wxUString( const wxUString &str ) { assign(str); } wxUString( const wxScopedU32CharBuffer &buf ) { assign(buf); } wxUString( const char *str ) { assign(str); } @@ -200,17 +199,43 @@ public: return (wxUString &) base->assign( str, pos, n ); } - wxUString &assign( wxChar32 ch ) - { - std::basic_string *base = this; - return (wxUString &) base->assign( (size_type) 1, ch ); - } + // FIXME-VC6: VC 6.0 stl does not support all types of assign functions + #ifdef __VISUALC6__ + wxUString &assign( wxChar32 ch ) + { + wxChar32 chh[1]; + chh[0] = ch; + std::basic_string *base = this; + return (wxUString &)base->assign(chh); + } - wxUString &assign( size_type n, wxChar32 ch ) - { - std::basic_string *base = this; - return (wxUString &) base->assign( n, ch ); - } + wxUString &assign( size_type n, wxChar32 ch ) + { + wxU32CharBuffer buffer(n); + wxChar32 *p = buffer.data(); + size_type i; + for (i = 0; i < n; i++) + { + *p = ch; + p++; + } + + std::basic_string *base = this; + return (wxUString &)base->assign(buffer.data()); + } + #else + wxUString &assign( wxChar32 ch ) + { + std::basic_string *base = this; + return (wxUString &) base->assign( (size_type) 1, ch ); + } + + wxUString &assign( size_type n, wxChar32 ch ) + { + std::basic_string *base = this; + return (wxUString &) base->assign( n, ch ); + } + #endif // __VISUALC6__ wxUString &assign( const wxScopedU32CharBuffer &buf ) { @@ -357,11 +382,29 @@ public: return (wxUString &) base->append( s, n ); } - wxUString &append( size_type n, wxChar32 c ) - { - std::basic_string *base = this; - return (wxUString &) base->append( n, c ); - } + // FIXME-VC6: VC 6.0 stl does not support all types of append functions + #ifdef __VISUALC6__ + wxUString &append( size_type n, wxChar32 c ) + { + wxU32CharBuffer buffer(n); + wxChar32 *p = buffer.data(); + size_type i; + for (i = 0; i < n; i++) + { + *p = c; + p++; + } + + std::basic_string *base = this; + return (wxUString &) base->append(buffer.data()); + } + #else + wxUString &append( size_type n, wxChar32 c ) + { + std::basic_string *base = this; + return (wxUString &) base->append( n, c ); + } + #endif // __VISUALC6__ wxUString &append( wxChar32 c ) { @@ -535,8 +578,6 @@ public: // operator = - wxUString& operator=(const wxUString& s) - { return assign( s ); } wxUString& operator=(const wxString& s) { return assign( s ); } wxUString& operator=(const wxCStrData* s)