X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..33baee46ee5c2476ac75d7893bf2272a65e525ab:/interface/wx/tokenzr.h diff --git a/interface/wx/tokenzr.h b/interface/wx/tokenzr.h index ef717d86e5..3614ae1a1a 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 ///////////////////////////////////////////////////////////////////////////// /** @@ -28,8 +28,8 @@ enum wxStringTokenizerMode /** In this mode, the empty tokens in the middle of the string will be returned, - i.e. @c "a::b:" will be tokenized in three tokens @c 'a', " and @c 'b'. Notice - that all trailing delimiters are ignored in this mode, not just the last one, + i.e. @c "a::b:" will be tokenized in three tokens @c 'a', @c '' and @c 'b'. + Notice that all trailing delimiters are ignored in this mode, not just the last one, i.e. a string @c "a::b::" would still result in the same set of tokens. */ wxTOKEN_RET_EMPTY, @@ -88,7 +88,7 @@ enum wxStringTokenizerMode @library{wxbase} @category{data} - @see wxStringTokenize() + @see ::wxStringTokenize() */ class wxStringTokenizer : public wxObject { @@ -115,7 +115,7 @@ public: GetNextToken() is called and when it reaches 0, HasMoreTokens() returns @false. */ - int CountTokens() const; + size_t CountTokens() const; /** Returns the delimiter which ended scan for the last token returned by @@ -125,12 +125,12 @@ public: @since 2.7.0 */ - wxChar GetLastDelimiter(); + wxChar GetLastDelimiter() const; /** Returns the next token or empty string if the end of string was reached. */ - wxString GetNextToken() const; + wxString GetNextToken(); /** Returns the current position (i.e. one index after the last returned @@ -158,3 +158,25 @@ public: const wxString& delims = " \t\r\n", 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/string.h} +*/ +wxArrayString +wxStringTokenize(const wxString& str, + const wxString& delims = wxDEFAULT_DELIMITERS, + wxStringTokenizerMode mode = wxTOKEN_DEFAULT); + +//@}