VCF::StringTokenizer Class Reference
Class for breaking a string into a series of one or more tokens.
More...
#include <vcf/FoundationKit/StringTokenizer.h>
Inheritance diagram for VCF::StringTokenizer:
List of all members.
Detailed Description
Class for breaking a string into a series of one or more tokens.
Usage:
StringTokenizer stk("Diddly piddly, dock, a big fat piece of apple nut cake!", " \n\r\f\t" );
while ( stk.hasMoreElements(true) ) {
String s1 = stk.nextElement();
String s2 = stk.prevElement();
printf( "s1 = %s, s2 = %s\n", s1.c_str(), s2.c_str() );
}
Constructor & Destructor Documentation
| VCF::StringTokenizer::StringTokenizer |
( |
const String & |
data |
) |
[inline] |
|
| VCF::StringTokenizer::StringTokenizer |
( |
const String & |
data, |
|
|
const String & |
delimiter |
|
) |
[inline] |
|
| VCF::StringTokenizer::StringTokenizer |
( |
const VCFChar * |
strPtr, |
|
|
size_t |
length, |
|
|
const String & |
delimiter = "" |
|
) |
[inline] |
|
| VCF::StringTokenizer::StringTokenizer |
( |
const StringTokenizer & |
|
) |
[inline, protected] |
|
Member Function Documentation
| void VCF::StringTokenizer::assign |
( |
const String & |
data, |
|
|
const String & |
delimiter = "" |
|
) |
[inline] |
|
| void VCF::StringTokenizer::getElements |
( |
std::vector< String > & |
elements |
) |
[inline] |
|
| virtual bool VCF::StringTokenizer::hasMoreElements |
( |
const bool & |
backward = false |
) |
const [inline, virtual] |
|
|
|
indicates whether there are any more children to enumerate through
- Parameters:
-
| bool | specifies whether the enumeration should be forwards or backwards. The default value is true for enumerating forwards. |
- Returns:
- bool true if there are any elements left to enumerate, otherwise returns false.
Implements VCF::Enumerator< String >. |
| virtual String VCF::StringTokenizer::nextElement |
( |
|
) |
[inline, virtual] |
|
|
|
returns the next element in the enumeration.
Moves the internal iterator forward - Returns:
- COLLECTION_TYPE returns a COLLECTION_TYPE value of whatever type was specified in the template argument to the Enumerator
Implements VCF::Enumerator< String >. |
| virtual String VCF::StringTokenizer::prevElement |
( |
|
) |
[inline, virtual] |
|
|
|
returns the previous element in the enumeration.
Moves the internal iterator backward - Returns:
- COLLECTION_TYPE returns a COLLECTION_TYPE value of whatever type was specified in the template argument to the Enumerator
Implements VCF::Enumerator< String >. |
| virtual void VCF::StringTokenizer::reset |
( |
const bool & |
backward = false |
) |
const [inline, virtual] |
|
|
|
Resets the Enumerator's internal iterator back to the beginning (or end, if backward is true).
- Parameters:
-
| bool | specifies which direction to reset to |
Implements VCF::Enumerator< String >. |
Member Data Documentation
The documentation for this class was generated from the following file: