StringTokenizer Class Reference

String tokenizer class, similar to Java's java.util.StringTokenizer. More...

#include <StringTokenizer.h>

List of all members.

Public Member Functions

 StringTokenizer (const char *tokenizeMe, const char *separators=", \t")
 Initializes the StringTokenizer to parse (tokenizeMe), which should be a string of tokens (e.g.
 StringTokenizer (bool junk, char *tokenizeMe, const char *separators=", \t")
 This Constructor is the same as above, only with this one you allow the StringTokenizer to operator directly on (tokenizeMe) rather than making it allocate a copy first.
 ~StringTokenizer ()
 Destructor.
char * GetNextToken ()
 Returns the next token in the parsed string, or NULL if there are no more tokens left.
char * operator() ()
 Convenience synonym for GetNextToken().
char * GetRemainderOfString ()
 Returns the remainder of the string, starting with the next token, or NULL if there are no more tokens in the string.


Detailed Description

String tokenizer class, similar to Java's java.util.StringTokenizer.

Definition at line 11 of file StringTokenizer.h.


Constructor & Destructor Documentation

StringTokenizer::StringTokenizer ( const char *  tokenizeMe,
const char *  separators = ", \t" 
) [inline]

Initializes the StringTokenizer to parse (tokenizeMe), which should be a string of tokens (e.g.

words) separated by any of the characters specified in (separators)

Parameters:
tokenizeMe the string to break up into 'words'.
separators ASCII string representing a list of characters to interpret a word separators. Defaults to ", \t" (where "\t" is of course the tab character)

Definition at line 21 of file StringTokenizer.h.

StringTokenizer::StringTokenizer ( bool  junk,
char *  tokenizeMe,
const char *  separators = ", \t" 
) [inline]

This Constructor is the same as above, only with this one you allow the StringTokenizer to operator directly on (tokenizeMe) rather than making it allocate a copy first.

(it's a bit more efficient)

Parameters:
junk Ignored; it's only here to disambiguate the two constructors.
tokenizeMe The string to tokenize. This string will get munged!
separators ASCII string representing a list of characters to interpret a word separators. Defaults to ", \t" (where "\t" is of course the tab character)

Definition at line 51 of file StringTokenizer.h.


Member Function Documentation

char* StringTokenizer::GetRemainderOfString (  )  [inline]

Returns the remainder of the string, starting with the next token, or NULL if there are no more tokens in the string.

Doesn't affect the next return value of GetNextToken(), though.

Definition at line 97 of file StringTokenizer.h.


The documentation for this class was generated from the following file:
Generated on Mon Apr 28 13:59:44 2008 for MUSCLE by  doxygen 1.5.1