ScummVM API documentation
Common::StringTokenizer Class Reference

#include <tokenizer.h>

Public Member Functions

 StringTokenizer (const String &str, const String &delimiters=" \\\)
 
void reset ()
 Resets the tokenizer to its initial state.
 
bool empty () const
 Returns true if there are no more tokens left in the string, false otherwise.
 
String nextToken ()
 Returns the next token from the string (Or an empty string if there are no more tokens)
 
StringArray split ()
 Returns StringArray with all tokens. Beware of the memory usage.
 
String delimitersAtTokenBegin () const
 Returns a String with all delimiters between the current and previous token.
 
String delimitersAtTokenEnd () const
 Returns a String with all delimiters between the current and next token.
 

Detailed Description

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().

Constructor & Destructor Documentation

◆ StringTokenizer()

Common::StringTokenizer::StringTokenizer ( const String str)

Creates a StringTokenizer.

Parameters
strThe string to be tokenized.
delimitersString containing all the delimiter characters (i.e. the characters to be ignored).
Note
Uses space, horizontal tab, carriage return, newline, form feed and vertical tab as delimiters by default.

The documentation for this class was generated from the following file: