#include <tokenizer.h>
Static Public Member Functions | |
static std::vector< std::string > | Tokenize (const std::string &String, const Predicate &P=Predicate()) |
Definition at line 57 of file tokenizer.h.
static std::vector<std::string> CTokenizer< Predicate >::Tokenize | ( | const std::string & | String, | |
const Predicate & | P = Predicate() | |||
) | [inline, static] |
Definition at line 60 of file tokenizer.h.
00061 { 00062 std::vector<std::string> Tokens; 00063 std::string::const_iterator It(String.begin()); 00064 std::string::const_iterator ItTokenEnd(String.begin()); 00065 00066 00067 while( It != String.end() ) 00068 { 00069 while( P(*It) ) 00070 It++; 00071 00072 ItTokenEnd = find_if(It, String.end(), P); 00073 00074 if( It < ItTokenEnd ) 00075 Tokens.push_back(std::string(It, ItTokenEnd)); 00076 00077 It = ItTokenEnd; 00078 } 00079 00080 return Tokens; 00081 }