DSStrTok


Discussion

The StrTok class is a simple string tokeniser. It breaks up an input string according to a seperator.

Member Functions


DSStrTok


public:

DSStrTok (     char * string,     char sep=' ' );
Discussion

This constructs a new StrTok for a specified input string, and a specified character to use for breaking it up.

Parameter Descriptions
string
The input string to be broken up.
sep
The character to use as a seperator.

getElement


public:

char * getElement (     int i );
Discussion

This function retrieves the specified portion of the broken string.

Parameter Descriptions
i
The 0-based index number of the portion of the string needed.
function result
A pointer to the portion of the string requested.

getNumElements


public:

int getNumElements (void);
Discussion

This function retrieves the number of portions in the broken string.

function result
The number of portions in the larger string.

~DSStrTok


public:

~DSStrTok (void);
Discussion

Destroys a StrTok.

(Last Updated 9/24/2004)