43 |
|
|
44 |
|
/** |
45 |
|
* @class StringTokenizer.hpp "util/StringTokenizer.hpp" |
46 |
– |
* |
46 |
|
* @brief The string tokenizer class allows an application to break a string into tokens |
48 |
– |
* |
47 |
|
* The set of delimiters (the characters that separate tokens) may be specified either |
48 |
|
* at creation time or on a per-token basis. |
49 |
|
* An instance of StringTokenizer behaves in one of two ways, depending on whether it was |
59 |
|
* separators between tokens. |
60 |
|
* @param str a string to be parsed. |
61 |
|
* @param delim the delimiters, default value is " \t\n\r". |
62 |
+ |
* @note this is still a little bit java like implementation. Pure c++ one should use TokenIterator. |
63 |
+ |
* Boost's tokenizer class is one of them |
64 |
|
*/ |
65 |
|
StringTokenizer(const std::string & str, |
66 |
|
const std::string & delim = defaultDelim); |
67 |
|
|
68 |
+ |
/** |
69 |
+ |
* Constructs a string tokenizer for an iterator range [first, last). The characters in the delim argument |
70 |
+ |
* are the delimiters for separating tokens. characters are skipped and only serve as |
71 |
+ |
* separators between tokens. |
72 |
+ |
* @param first begin iterator |
73 |
+ |
* @param last end iterator |
74 |
+ |
* @param delim the delimiters, default value is " \t\n\r". |
75 |
+ |
* @note this is still a little bit java like implementation. Pure c++ one should use TokenIterator. |
76 |
+ |
* Boost's tokenizer class is one of them |
77 |
+ |
*/ |
78 |
|
StringTokenizer(std::string::const_iterator& first, std::string::const_iterator& last, |
79 |
|
const std::string & delim = defaultDelim); |
80 |
|
|
124 |
|
float nextTokenAsFloat(); |
125 |
|
|
126 |
|
/** |
127 |
+ |
* Returns the next token from this string tokenizer as a double. |
128 |
+ |
* @return the next token from this string tokenizer as a double. |
129 |
+ |
*/ |
130 |
+ |
double nextTokenAsDouble(); |
131 |
+ |
|
132 |
+ |
/** |
133 |
|
* Returns the next token without advancing the position of the StringTokenizer. |
134 |
|
* @return the next token |
135 |
|
*/ |