- const wxChar *str; // string to tokenize
- const wxChar *delims; // delimiters to use
- size_t count; // count of token
- bool with; // return tokens with delimiters?
- } tokenizerTestData[] =
- {
- { _T(""), _T(" "), 0, FALSE },
- { _T("Hello, world"), _T(" "), 2, FALSE },
- { _T("Hello, world"), _T(","), 2, FALSE },
- { _T("Hello, world!"), _T(",!"), 3, TRUE },
- { _T("username:password:uid:gid:gecos:home:shell"), _T(":"), 7, FALSE },
- { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, 9, TRUE },
- { _T("01/02/99"), _T("/-"), 3, FALSE },
+ const wxChar *str; // string to tokenize
+ const wxChar *delims; // delimiters to use
+ size_t count; // count of token
+ wxStringTokenizerMode mode; // how should we tokenize it
+ } tokenizerTestData[] =
+ {
+ { _T(""), _T(" "), 0 },
+ { _T("Hello, world"), _T(" "), 2 },
+ { _T("Hello, world "), _T(" "), 2 },
+ { _T("Hello, world"), _T(","), 2 },
+ { _T("Hello, world!"), _T(",!"), 2 },
+ { _T("Hello,, world!"), _T(",!"), 3 },
+ { _T("Hello, world!"), _T(",!"), 3, wxTOKEN_RET_EMPTY_ALL },
+ { _T("username:password:uid:gid:gecos:home:shell"), _T(":"), 7 },
+ { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, 4 },
+ { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, 6, wxTOKEN_RET_EMPTY },
+ { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, 9, wxTOKEN_RET_EMPTY_ALL },
+ { _T("01/02/99"), _T("/-"), 3 },
+ { _T("01-02/99"), _T("/-"), 3, wxTOKEN_RET_DELIMS },