|
@@ -222,6 +222,12 @@ inline char_t getFloat( char_t it, char_t end, float &value )
|
|
return it;
|
|
return it;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/** @brief Will perform a simple tokenize.
|
|
|
|
+ * @param str String to tokenize.
|
|
|
|
+ * @param tokens Array with tokens, will be empty if no token was found.
|
|
|
|
+ * @param delimiters Delimiter for tokenize.
|
|
|
|
+ * @return Number of found token.
|
|
|
|
+ */
|
|
template<class string_type>
|
|
template<class string_type>
|
|
unsigned int tokenize( const string_type& str, std::vector<string_type>& tokens,
|
|
unsigned int tokenize( const string_type& str, std::vector<string_type>& tokens,
|
|
const string_type& delimiters )
|
|
const string_type& delimiters )
|
|
@@ -230,7 +236,7 @@ unsigned int tokenize( const string_type& str, std::vector<string_type>& tokens,
|
|
string_type::size_type lastPos = str.find_first_not_of( delimiters, 0 );
|
|
string_type::size_type lastPos = str.find_first_not_of( delimiters, 0 );
|
|
|
|
|
|
// Find first "non-delimiter".
|
|
// Find first "non-delimiter".
|
|
- string_type::size_type pos = str.find_first_of( delimiters, lastPos );
|
|
|
|
|
|
+ size_t pos = str.find_first_of( delimiters, lastPos );
|
|
while ( string_type::npos != pos || string_type::npos != lastPos )
|
|
while ( string_type::npos != pos || string_type::npos != lastPos )
|
|
{
|
|
{
|
|
// Found a token, add it to the vector.
|
|
// Found a token, add it to the vector.
|