@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
{
//@}
};
-/** @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);
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.
+ Comparison operators char types.
*/
inline bool operator==(const wxUniChar& c, const wxString& s);
inline bool operator==(const wxUniCharRef& c, const wxString& s);
-
/**
@class wxStringBufferLength
*/
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<wxIsdigit>(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<bool (T)(const wxUniChar& c)>
+ inline bool wxStringCheck(const wxString& val);
+
+//@}