Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

StringTokenizer Class Reference

#include <StringTokenizer.hpp>

Collaboration diagram for StringTokenizer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 StringTokenizer (const std::string &tokenizable_)
std::string nextToken ()
bool hasMoreTokens ()
int countTokens ()
string getRemainingTokens ()

Private Member Functions

int initialTokenCount ()

Private Attributes

std::string tokenizable
int nextAnalyzableChar
int remainingTokens

Detailed Description

StringTokenizer - decompose a string into tokens.

Those methods have the same name as the ones in java.util.StringTokenizer. It was developed with this objective.

Author:
Andrei Goldchleger


Constructor & Destructor Documentation

StringTokenizer::StringTokenizer const std::string &  tokenizable_  ) 
 

Constructs a Tokenizer.

Parameters:
tokenizable_ - the string to be tokenized


Member Function Documentation

int StringTokenizer::countTokens  ) 
 

Returns the number of available tokens in the string

string StringTokenizer::getRemainingTokens  ) 
 

Returns the string containing remaining tokens. DOES NOT advance the token pointer!!!!

bool StringTokenizer::hasMoreTokens  ) 
 

Indicates if more tokens are available.

int StringTokenizer::initialTokenCount  )  [private]
 

scans the string and count the number of tokens

string StringTokenizer::nextToken  ) 
 

Returns the next token contained in the string.


Member Data Documentation

int StringTokenizer::nextAnalyzableChar [private]
 

keeps the index of the next possible token

int StringTokenizer::remainingTokens [private]
 

number of remaining tokens

std::string StringTokenizer::tokenizable [private]
 

the string to be tokenized


The documentation for this class was generated from the following files:
Generated on Mon Sep 6 16:13:21 2004 by doxygen 1.3.3