X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/382f12e41917abf78fb7f00d786c7ead112e4df4..808f5a3aac2ca22a29396ccc460559d938bb5bc8:/interface/wx/string.h?ds=sidebyside diff --git a/interface/wx/string.h b/interface/wx/string.h index aa7e3d3266..b937a5267b 100644 --- a/interface/wx/string.h +++ b/interface/wx/string.h @@ -36,7 +36,7 @@ for important warnings and advices for using it, please read the @ref overview_string. - In wxWidgets 3.0 wxString always stores Unicode strings, so you should + Since wxWidgets 3.0 wxString always stores Unicode strings, so you should be sure to read also @ref overview_unicode. @@ -246,7 +246,8 @@ @stdobjects ::wxEmptyString - @see @ref overview_string, @ref overview_unicode, wxUString + @see @ref overview_string, @ref overview_unicode, wxUString, + wxCharBuffer, wxUniChar, wxStringTokenizer, @ref group_funcmacro_string */ class wxString { @@ -652,6 +653,8 @@ public: /** Returns @true if the string contains only ASCII characters. + See wxUniChar::IsAscii for more details. + This is a wxWidgets 1.xx compatibility function; you should not use it in new code. */ @@ -1139,7 +1142,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); @@ -1346,10 +1349,11 @@ public: //@} }; -/** @addtogroup group_string_operators */ + + //@{ /** - Comparison operators for wxString. + Comparison operator for string types. */ inline bool operator==(const wxString& s1, const wxString& s2); inline bool operator!=(const wxString& s1, const wxString& s2); @@ -1369,13 +1373,11 @@ 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); -inline wxString operator+(const wxString& string, const wxWCharBuffer& buf) -inline wxString operator+(const wxWCharBuffer& buf, const wxString& string) -inline wxString operator+(const wxString& string, const wxCharBuffer& buf) -inline wxString operator+(const wxCharBuffer& buf, const wxString& string) +//@} +//@{ /** - Comparison operators with wxUniChar or wxUniCharRef. + Comparison operators char types. */ inline bool operator==(const wxUniChar& c, const wxString& s); inline bool operator==(const wxUniCharRef& c, const wxString& s); @@ -1405,7 +1407,6 @@ wxString wxEmptyString; - /** @class wxStringBufferLength @@ -1528,3 +1529,29 @@ public: */ wxStringCharType* operator wxStringCharType *(); }; + + +/** @addtogroup group_funcmacro_string */ +//@{ + +/** + Allows to extend a function with the signature: + @code bool SomeFunc(const wxUniChar& c) @endcode + which operates on a single character, to an entire wxString. + + E.g. if you want to check if an entire string contains only digits, + you can do: + @code + if (wxStringCheck(myString)) + ... // the entire string contains oly digits! + else + ... // at least one character of myString is not a digit + @endcode + + @return @true if the given function returns a non-zero value for all + characters of the @a val string. +*/ +template + inline bool wxStringCheck(const wxString& val); + +//@}