- wxStringTokenizer(const wxString& to_tokenize,
- const wxString& delims = " \t\r\n",
- bool ret_delim = FALSE);
- ~wxStringTokenizer();
-
- int CountTokens();
- bool HasMoreToken();
- wxString NextToken();
- wxString GetString() { return m_string; }
-protected:
- off_t FindDelims(const wxString& str, const wxString& delims);
+ // ctors and such
+ wxStringTokenizer() { m_retdelims = FALSE; m_pos = 0; }
+ wxStringTokenizer(const wxString& to_tokenize,
+ const wxString& delims = wxDEFAULT_DELIMITERS,
+ bool ret_delim = FALSE);
+ void SetString(const wxString& to_tokenize,
+ const wxString& delims = wxDEFAULT_DELIMITERS,
+ bool ret_delim = FALSE);
+ virtual ~wxStringTokenizer();
+
+ // count tokens/get next token
+ size_t CountTokens() const;
+ bool HasMoreTokens() { return m_hasMore; }
+ wxString GetNextToken();
+
+ // One note about GetString -- it returns the string
+ // remaining after the previous tokens have been removed,
+ // not the original string
+ wxString GetString() const { return m_string; }
+
+ // 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
+ size_t GetPosition() const { return m_pos; }
+
+ // for compatibility only, use GetNextToken() instead
+ wxString NextToken() { return GetNextToken(); }
+