X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ad813b00d5956f35f2b1585a276095e24ce8ad5a..284b4c8866ab36694b6ec2a308690bba4db4fed2:/include/wx/tokenzr.h diff --git a/include/wx/tokenzr.h b/include/wx/tokenzr.h index 764b4c8091..1668cd47ba 100644 --- a/include/wx/tokenzr.h +++ b/include/wx/tokenzr.h @@ -20,36 +20,38 @@ #include "wx/string.h" #include "wx/filefn.h" -class wxStringTokenizer : public wxObject { +class WXDLLEXPORT 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; - } + wxStringTokenizer(const wxString& to_tokenize, + const wxString& delims = " \t\r\n", + bool ret_delim = FALSE); + wxStringTokenizer() { m_retdelims = FALSE;} + virtual ~wxStringTokenizer(); + + int CountTokens() const; + bool HasMoreTokens(); + + wxString NextToken(); + wxString GetNextToken() { return NextToken(); }; + + wxString GetString() const { 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); -protected: - wxString m_string, m_delims; - bool m_retdelims; + off_t FindDelims(const wxString& str, const wxString& delims) const; + void EatLeadingDelims(); + + wxString m_string, m_delims; + bool m_retdelims; }; -#endif +#endif // _WX_TOKENZRH