クラス | |
class | wxStringTokenizer |
wxStringTokenizer helps you to break a string up into a number of tokens. More... | |
Defines | |
#define | wxDEFAULT_DELIMITERS " \t\r\n" |
Default wxStringTokenizer delimiters are the usual white space characters. | |
Enumerations | |
enum | wxStringTokenizerMode { wxTOKEN_INVALID = -1, wxTOKEN_DEFAULT, wxTOKEN_RET_EMPTY, wxTOKEN_RET_EMPTY_ALL, wxTOKEN_RET_DELIMS, wxTOKEN_STRTOK } |
The behaviour of wxStringTokenizer is governed by the wxStringTokenizer::wxStringTokenizer() or wxStringTokenizer::SetString() with the parameter mode, which may be one of the following: More... | |
Functions | |
wxArrayString | wxStringTokenize (const wxString &str, const wxString &delims=wxDEFAULT_DELIMITERS, wxStringTokenizerMode mode=wxTOKEN_DEFAULT) |
This is a convenience function wrapping wxStringTokenizer which simply returns all tokens found in the given str as an array. |
#define wxDEFAULT_DELIMITERS " \t\r\n" |
Default wxStringTokenizer delimiters are the usual white space characters.
The behaviour of wxStringTokenizer is governed by the wxStringTokenizer::wxStringTokenizer() or wxStringTokenizer::SetString() with the parameter mode, which may be one of the following:
wxTOKEN_INVALID |
Invalid tokenizer mode. |
wxTOKEN_DEFAULT |
Default behaviour: wxStringTokenizer will behave in the same way as This is helpful for parsing strictly formatted data where the number of fields is fixed but some of them may be empty (i.e. |
wxTOKEN_RET_EMPTY |
In this mode, the empty tokens in the middle of the string will be returned, i.e.
|
wxTOKEN_RET_EMPTY_ALL |
In this mode, empty trailing tokens (including the one after the last delimiter character) will be returned as well. The string |
wxTOKEN_RET_DELIMS |
In this mode, the delimiter character after the end of the current token (there may be none if this is the last token) is returned appended to the token. Otherwise, it is the same mode as wxTOKEN_RET_EMPTY. Notice that there is no mode like this one but behaving like wxTOKEN_RET_EMPTY_ALL instead of wxTOKEN_RET_EMPTY, use wxTOKEN_RET_EMPTY_ALL and wxStringTokenizer::GetLastDelimiter() to emulate it. |
wxTOKEN_STRTOK |
In this mode the class behaves exactly like the standard |