#include <tokenizer.h>
Public Member Functions | |
BaseStringTokenizer (const T &str, const String &delimiters=" \\\) | |
void | reset () |
Resets the tokenizer to its initial state, i.e points boten token iterators to the beginning. | |
bool | empty () const |
Returns true if there are no more tokens left in the string, false otherwise. | |
T | nextToken () |
Returns the next token from the string (Or an empty string if there are no more tokens) | |
Array< T > | split () |
Returns an Array with all tokens. Beware of the memory usage. | |
T | delimitersAtTokenBegin () const |
Returns a String with all delimiters between the current and previous token. | |
T | delimitersAtTokenEnd () const |
Returns a String with all delimiters between the current and next token. | |
A simple non-optimized string tokenizer.
Example of use: StringTokenizer("Now, this is a test!", " ,!") gives tokens "Now", "this", "is", "a" and "test" using nextToken().
Common::BaseStringTokenizer< T >::BaseStringTokenizer | ( | const T & | str | ) |
Creates a BaseStringTokenizer.
str | The string to be tokenized. |
delimiters | String containing all the delimiter characters (i.e. the characters to be ignored). |