X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c058d771426b4843f9096f68f919f5630b6f5879..587ce561e1deabbfacf0d619fdd6bb3899430720:/include/wx/tokenzr.h diff --git a/include/wx/tokenzr.h b/include/wx/tokenzr.h index 7de58feed3..8012854ac6 100644 --- a/include/wx/tokenzr.h +++ b/include/wx/tokenzr.h @@ -20,19 +20,35 @@ #include "wx/string.h" #include "wx/filefn.h" -class wxStringTokenizer : wxObject { +class wxStringTokenizer : public wxObject { public: wxStringTokenizer(const wxString& to_tokenize, const wxString& delims = " \t\r\n", bool ret_delim = FALSE); + wxStringTokenizer() { m_string = ""; m_delims = ""; m_retdelims = FALSE;} ~wxStringTokenizer(); int CountTokens(); bool HasMoreToken(); + inline bool HasMoreTokens() { return HasMoreToken(); }; wxString NextToken(); + // A better name! + inline wxString GetNextToken() { return NextToken(); }; wxString GetString() { return m_string; } + + void SetString(const wxString& to_tokenize, + const wxString& delims = " \t\r\n", + bool ret_delim = FALSE) + { + m_string = to_tokenize; + m_delims = delims; + m_retdelims = ret_delim; + } + protected: off_t FindDelims(const wxString& str, const wxString& delims); + void EatLeadingDelims(); // AVS - added to fix leading whitespace / + // mult. delims bugs protected: wxString m_string, m_delims; bool m_retdelims;