X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/163bd4f700765483562e95b19670c699d0821283..70f92ede85bdc11cc41338a78038b30b1ab43d4a:/interface/wx/tokenzr.h diff --git a/interface/wx/tokenzr.h b/interface/wx/tokenzr.h index ac7dcecefc..9e9b060d90 100644 --- a/interface/wx/tokenzr.h +++ b/interface/wx/tokenzr.h @@ -3,7 +3,7 @@ // Purpose: interface of wxStringTokenizer // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -59,6 +59,9 @@ enum wxStringTokenizerMode wxTOKEN_STRTOK }; +/// Default wxStringTokenizer delimiters are the usual white space characters. +#define wxDEFAULT_DELIMITERS " \t\r\n" + /** @class wxStringTokenizer @@ -88,7 +91,7 @@ enum wxStringTokenizerMode @library{wxbase} @category{data} - @see wxStringTokenize() + @see ::wxStringTokenize() */ class wxStringTokenizer : public wxObject { @@ -106,7 +109,7 @@ public: @see SetString() */ wxStringTokenizer(const wxString& str, - const wxString& delims = " \t\r\n", + const wxString& delims = wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode = wxTOKEN_DEFAULT); /** @@ -133,7 +136,7 @@ public: wxString GetNextToken(); /** - Returns the current position (i.e. one index after the last returned + Returns the current position (i.e.\ one index after the last returned token or 0 if GetNextToken() has never been called) in the original string. */ @@ -154,7 +157,29 @@ public: containing delimiters, and the @a mode specifying how the string should be tokenized. */ - void SetString(const wxString& to_tokenize, - const wxString& delims = " \t\r\n", + void SetString(const wxString& str, + const wxString& delims = wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode = wxTOKEN_DEFAULT); }; + + +/** @addtogroup group_funcmacro_string */ +//@{ + +/** + This is a convenience function wrapping wxStringTokenizer which simply + returns all tokens found in the given @a str as an array. + + Please see wxStringTokenizer::wxStringTokenizer for the description + of the other parameters. + + @return The array with the parsed tokens. + + @header{wx/tokenzr.h} +*/ +wxArrayString +wxStringTokenize(const wxString& str, + const wxString& delims = wxDEFAULT_DELIMITERS, + wxStringTokenizerMode mode = wxTOKEN_DEFAULT); + +//@}