#include <Utilities/General/interface/Tokenizer.h>
Public Types | |
typedef std::vector< std::string > | super |
Public Member Functions | |
void | join (std::string &out, const std::string &sep, bool alsoempty=true) const |
Tokenizer (const std::string &sep, const std::string &input, bool alsoempty=true) |
Definition at line 9 of file Tokenizer.h.
typedef std::vector<std::string> Tokenizer::super |
Definition at line 11 of file Tokenizer.h.
Tokenizer::Tokenizer | ( | const std::string & | sep, | |
const std::string & | input, | |||
bool | alsoempty = true | |||
) |
Definition at line 3 of file Tokenizer.cc.
00003 { 00004 size_type i=0, j=0; 00005 while( (j=input.find(sep,i))!=std::string::npos) { 00006 if (alsoempty || (j>i) ) push_back(input.substr(i,j-i)); 00007 i = j+sep.size(); 00008 } 00009 if (alsoempty || (i<input.size()) ) push_back(input.substr(i)); 00010 }