class skStringTokenizer

The string tokenizer class allows an application to break a string into tokens

Public Methods

skStringTokenizer(skString str, skString delim, bool returnDelims)
Constructs a string tokenizer for the specified string
skStringTokenizer(skString str, skString delim)
Constructs a string tokenizer for the specified string
skStringTokenizer(skString str)
Constructs a string tokenizer for the specified string
bool hasMoreTokens()
Tests if there are more tokens available from this tokenizer's string
skString nextToken()
Returns the next token from this string tokenizer
skString nextToken(skString delim)
Returns the next token in this string tokenizer's string
int countTokens()
Calculates the number of times that this tokenizer's nextToken method can be called

Documentation

The string tokenizer class allows an application to break a string into tokens
skStringTokenizer(skString str, skString delim, bool returnDelims)
Constructs a string tokenizer for the specified string. All characters in the delim argument are the delimiters for separating tokens.

Parameters:
str - a string to be parsed.
delim - the delimiters.
returnDelims - flag indicating whether to return the delimiters as tokens.

skStringTokenizer(skString str, skString delim)
Constructs a string tokenizer for the specified string. The characters in the delim argument are the delimiters for separating tokens. Delimiter characters themselves will not be treated as tokens.

Parameters:
str - a string to be parsed.
delim - the delimiters.

skStringTokenizer(skString str)
Constructs a string tokenizer for the specified string. The tokenizer uses the default delimiter set, which is " &92;t&92;n&92;r&92;f": the space character, the tab character, the newline character, the carriage-return character, and the form-feed character. Delimiter characters themselves will not be treated as tokens.

Parameters:
str - a string to be parsed.

bool hasMoreTokens()
Tests if there are more tokens available from this tokenizer's string. If this method returns true, then a subsequent call to nextToken with no argument will successfully return a token.

Returns:
true if and only if there is at least one token in the string after the current position; false otherwise.

skString nextToken()
Returns the next token from this string tokenizer.

Returns:
the next token from this string tokenizer.

skString nextToken(skString delim)
Returns the next token in this string tokenizer's string. First, the set of characters considered to be delimiters by this skStringTokenizer object is changed to be the characters in the string delim. Then the next token in the string after the current position is returned. The current position is advanced beyond the recognized token. The new delimiter set remains the default after this call.

Returns:
the next token, after switching to the new delimiter set.
Parameters:
delim - the new delimiters.

int countTokens()
Calculates the number of times that this tokenizer's nextToken method can be called. The current position is not advanced.

Returns:
the number of tokens remaining in the string using the current delimiter set.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de