CTokenizer< Predicate > Class Template Reference

#include <tokenizer.h>

List of all members.

Static Public Member Functions

static std::vector< std::string > Tokenize (const std::string &String, const Predicate &P=Predicate())


Detailed Description

template<typename Predicate>
class CTokenizer< Predicate >

Definition at line 57 of file tokenizer.h.


Member Function Documentation

template<typename Predicate >
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         }


The documentation for this class was generated from the following file:

Generated on Tue Aug 30 02:36:58 2011 for Smacky by  doxygen 1.5.8