break string into words
More...
#include <tokenizer.h>
|
using | iterator = boost::tokenizer<boost::char_separator<char>>::iterator |
|
|
| Tokenizer (const std::string &str, const char *separators) |
| startup tokenization
|
|
| Tokenizer (const std::string &str, const std::string &separators) |
|
iterator | begin () |
| iterator to first element
|
|
iterator | end () |
| end iterator
|
|
template<class T = std::string> |
std::vector< T > | ToVector () |
| store all words in a vector of type T, does type conversion.
|
|
|
std::unique_ptr< boost::tokenizer< boost::char_separator< char > > > | tok_ |
|
std::string | str_ |
|
break string into words
This class wraps boost::tokenizer to break a string into words. A list of delimeters can be freely choosen.
Definition at line 72 of file tokenizer.h.
◆ iterator
◆ Tokenizer() [1/2]
votca::tools::Tokenizer::Tokenizer |
( |
const std::string & | str, |
|
|
const char * | separators ) |
|
inline |
startup tokenization
- Parameters
-
str | string to break up |
separators | list of separators |
After initialization,the words can be accessed using the iterator interface or directly transferred to a vector ToVector of ConvertToVector.
Definition at line 85 of file tokenizer.h.
◆ Tokenizer() [2/2]
votca::tools::Tokenizer::Tokenizer |
( |
const std::string & | str, |
|
|
const std::string & | separators ) |
|
inline |
◆ begin()
iterator votca::tools::Tokenizer::begin |
( |
| ) |
|
|
inline |
iterator to first element
- Returns
- begin iterator
Definition at line 97 of file tokenizer.h.
◆ end()
iterator votca::tools::Tokenizer::end |
( |
| ) |
|
|
inline |
end iterator
- Returns
- end iterator
Definition at line 102 of file tokenizer.h.
◆ ToVector()
template<class T = std::string>
std::vector< T > votca::tools::Tokenizer::ToVector |
( |
| ) |
|
|
inline |
store all words in a vector of type T, does type conversion.
- Returns
- storage vector
Definition at line 109 of file tokenizer.h.
◆ str_
std::string votca::tools::Tokenizer::str_ |
|
private |
◆ tok_
std::unique_ptr<boost::tokenizer<boost::char_separator<char> > > votca::tools::Tokenizer::tok_ |
|
private |
The documentation for this class was generated from the following file: