X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/727aa9062ba6ffa3153069e15df38dca958172d5..d8efd2198ff050ca5a5726bcad0f42692fe872df:/interface/wx/string.h diff --git a/interface/wx/string.h b/interface/wx/string.h index 7d57b228a6..80f58699d1 100644 --- a/interface/wx/string.h +++ b/interface/wx/string.h @@ -488,26 +488,6 @@ public: */ int CmpNoCase(const wxString& s) const; - - //@{ - /** - Comparison operators - */ - bool operator ==(const wxString& x, const wxString& y); - bool operator ==(const wxString& x, wxUniChar ch); - bool operator !=(const wxString& x, const wxString& y); - bool operator !=(const wxString& x, wxUniChar ch); - bool operator(const wxString& x, const wxString& y); - bool operator(const wxString& x, wxUniChar ch); - bool operator =(const wxString& x, const wxString& y); - bool operator =(const wxString& x, wxUniChar ch); - bool operator(const wxString& x, const wxString& y); - bool operator(const wxString& x, wxUniChar ch); - bool operator =(const wxString& x, const wxString& y); - bool operator =(const wxString& x, wxUniChar ch); - //@} - - /** Returns @true if target appears anywhere in wxString; else @false. This is a wxWidgets 1.xx compatibility function; you should not use it in new @@ -559,7 +539,7 @@ public: @see FormatV(), Printf() */ - static wxString Format(const wxChar format, ...); + static wxString Format(const wxString& format, ...); /** This static function returns the string containing the result of calling @@ -567,7 +547,7 @@ public: @see Format(), PrintfV() */ - static wxString FormatV(const wxChar format, va_list argptr); + static wxString FormatV(const wxString& format, va_list argptr); /** Returns the number of occurrences of @e ch in the string. @@ -1119,8 +1099,6 @@ public: wxString& operator<<(const char* psz); wxString& operator<<(const wchar_t* pwz); wxString& operator<<(const wxCStrData& psz); - wxString& operator<<(const char* psz); - wxString& operator<<(wxUniCharRef ch); wxString& operator<<(char ch); wxString& operator<<(unsigned char ch); wxString& operator<<(wchar_t ch); @@ -1161,7 +1139,7 @@ public: //@{ /** Assignment: the effect of each operation is the same as for the corresponding - constructor (see @ref wxString() "wxString constructors"). + constructor (see wxString constructors). */ wxString operator =(const wxString& str); wxString operator =(wxUniChar c); @@ -1301,20 +1279,20 @@ public: size_t find_first_of(const wchar_t* sz, size_t nStart = 0) const; size_t find_first_of(const char* sz, size_t nStart, size_t n) const; size_t find_first_of(const wchar_t* sz, size_t nStart, size_t n) const; - size_t find_first_of(wxUniChar c, size_t nStart = 0) const - size_t find_last_of (const wxString& str, size_t nStart = npos) const + size_t find_first_of(wxUniChar c, size_t nStart = 0) const; + size_t find_last_of (const wxString& str, size_t nStart = npos) const; size_t find_last_of (const char* sz, size_t nStart = npos) const; size_t find_last_of (const wchar_t* sz, size_t nStart = npos) const; size_t find_last_of(const char* sz, size_t nStart, size_t n) const; size_t find_last_of(const wchar_t* sz, size_t nStart, size_t n) const; - size_t find_last_of(wxUniChar c, size_t nStart = npos) const - size_t find_first_not_of(const wxString& str, size_t nStart = 0) const + size_t find_last_of(wxUniChar c, size_t nStart = npos) const; + size_t find_first_not_of(const wxString& str, size_t nStart = 0) const; size_t find_first_not_of(const char* sz, size_t nStart = 0) const; size_t find_first_not_of(const wchar_t* sz, size_t nStart = 0) const; size_t find_first_not_of(const char* sz, size_t nStart, size_t n) const; size_t find_first_not_of(const wchar_t* sz, size_t nStart, size_t n) const; size_t find_first_not_of(wxUniChar ch, size_t nStart = 0) const; - size_t find_last_not_of(const wxString& str, size_t nStart = npos) const + size_t find_last_not_of(const wxString& str, size_t nStart = npos) const; size_t find_last_not_of(const char* sz, size_t nStart = npos) const; size_t find_last_not_of(const wchar_t* sz, size_t nStart = npos) const; size_t find_last_not_of(const char* sz, size_t nStart, size_t n) const; @@ -1339,23 +1317,23 @@ public: wxString& replace(size_t nStart, size_t nLen, const wxString& str); wxString& replace(size_t nStart, size_t nLen, size_t nCount, wxUniChar ch); wxString& replace(size_t nStart, size_t nLen, - const wxString& str, size_t nStart2, size_t nLen2); + const wxString& str, size_t nStart2, size_t nLen2); wxString& replace(size_t nStart, size_t nLen, - const char* sz, size_t nCount); + const char* sz, size_t nCount); wxString& replace(size_t nStart, size_t nLen, - const wchar_t* sz, size_t nCount); + const wchar_t* sz, size_t nCount); wxString& replace(size_t nStart, size_t nLen, - const wxString& s, size_t nCount); + const wxString& s, size_t nCount); wxString& replace(iterator first, iterator last, const wxString& s); wxString& replace(iterator first, iterator last, const char* s, size_type n); wxString& replace(iterator first, iterator last, const wchar_t* s, size_type n); wxString& replace(iterator first, iterator last, size_type n, wxUniChar ch); wxString& replace(iterator first, iterator last, - const_iterator first1, const_iterator last1); + const_iterator first1, const_iterator last1); wxString& replace(iterator first, iterator last, - const char *first1, const char *last1); + const char *first1, const char *last1); wxString& replace(iterator first, iterator last, - const wchar_t *first1, const wchar_t *last1); + const wchar_t *first1, const wchar_t *last1); size_t rfind(const wxString& str, size_t nStart = npos) const; size_t rfind(const char* sz, size_t nStart = npos, size_t n = npos) const; @@ -1368,6 +1346,53 @@ public: //@} }; +/** @addtogroup group_string_operators */ +//@{ +/** + Comparison operators for wxString. +*/ +inline bool operator==(const wxString& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxString& s2); +inline bool operator< (const wxString& s1, const wxString& s2); +inline bool operator> (const wxString& s1, const wxString& s2); +inline bool operator<=(const wxString& s1, const wxString& s2); +inline bool operator>=(const wxString& s1, const wxString& s2); +inline bool operator==(const wxString& s1, const wxCStrData& s2); +inline bool operator==(const wxCStrData& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxCStrData& s2); +inline bool operator!=(const wxCStrData& s1, const wxString& s2); +inline bool operator==(const wxString& s1, const wxWCharBuffer& s2); +inline bool operator==(const wxWCharBuffer& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxWCharBuffer& s2); +inline bool operator!=(const wxWCharBuffer& s1, const wxString& s2); +inline bool operator==(const wxString& s1, const wxCharBuffer& s2); +inline bool operator==(const wxCharBuffer& s1, const wxString& s2); +inline bool operator!=(const wxString& s1, const wxCharBuffer& s2); +inline bool operator!=(const wxCharBuffer& s1, const wxString& s2); + +/** + Comparison operators with wxUniChar or wxUniCharRef. +*/ +inline bool operator==(const wxUniChar& c, const wxString& s); +inline bool operator==(const wxUniCharRef& c, const wxString& s); +inline bool operator==(char c, const wxString& s); +inline bool operator==(wchar_t c, const wxString& s); +inline bool operator==(int c, const wxString& s); +inline bool operator==(const wxString& s, const wxUniChar& c); +inline bool operator==(const wxString& s, const wxUniCharRef& c); +inline bool operator==(const wxString& s, char c); +inline bool operator==(const wxString& s, wchar_t c); +inline bool operator!=(const wxUniChar& c, const wxString& s); +inline bool operator!=(const wxUniCharRef& c, const wxString& s); +inline bool operator!=(char c, const wxString& s); +inline bool operator!=(wchar_t c, const wxString& s); +inline bool operator!=(int c, const wxString& s); +inline bool operator!=(const wxString& s, const wxUniChar& c); +inline bool operator!=(const wxString& s, const wxUniCharRef& c); +inline bool operator!=(const wxString& s, char c); +inline bool operator!=(const wxString& s, wchar_t c); +//@} + /** The global wxString instance of an empty string. Used extensively in the entire wxWidgets API.