]> git.saurik.com Git - wxWidgets.git/blob - include/wx/tokenzr.h
Some doc corrections; removed wxDocument arg from wxView constructor;
[wxWidgets.git] / include / wx / tokenzr.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tokenzr.h
3 // Purpose: String tokenizer
4 // Author: Guilhem Lavaux
5 // Modified by:
6 // Created: 04/22/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_TOKENZRH
13 #define _WX_TOKENZRH
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "wx/object.h"
20 #include "wx/string.h"
21 #include "wx/filefn.h"
22
23 class wxStringTokenizer : public wxObject {
24 public:
25 wxStringTokenizer(const wxString& to_tokenize,
26 const wxString& delims = " \t\r\n",
27 bool ret_delim = FALSE);
28 wxStringTokenizer() { m_string = ""; m_delims = ""; m_retdelims = FALSE;}
29 ~wxStringTokenizer();
30
31 int CountTokens();
32 bool HasMoreToken();
33 wxString NextToken();
34 wxString GetString() { return m_string; }
35
36 void SetString(const wxString& to_tokenize,
37 const wxString& delims = " \t\r\n",
38 bool ret_delim = FALSE)
39 {
40 m_string = to_tokenize;
41 m_delims = delims;
42 m_retdelims = ret_delim;
43 }
44
45 protected:
46 off_t FindDelims(const wxString& str, const wxString& delims);
47 protected:
48 wxString m_string, m_delims;
49 bool m_retdelims;
50 };
51
52 #endif