Class to extract tokens from a string.
More...
#include <Utilities.h>
|
| StrTokens (const std::string &_s, const std::string &_sep) |
| Constructor: Pass in the string to separate and the separators. More...
|
|
std::string | next () |
| returns the next token, can be the empty string if two tokens follow immediately, or if finished() More...
|
|
std::string | next (const std::string &_sep) |
| (re)sets the separators, then returns the next token More...
|
|
int | count () const |
| returns how many finds have been returned so far More...
|
|
bool | finished () const |
| have all tokens been returned? More...
|
|
|
const std::string & | s |
| reference to the string to search More...
|
|
std::string | sep |
| separators More...
|
|
size_t | p = std::string::npos |
| points to last separator found More...
|
|
int | num = 0 |
| counts the findings More...
|
|
Class to extract tokens from a string.
◆ StrTokens()
StrTokens::StrTokens |
( |
const std::string & |
_s, |
|
|
const std::string & |
_sep |
|
) |
| |
|
inline |
Constructor: Pass in the string to separate and the separators.
◆ count()
int StrTokens::count |
( |
| ) |
const |
|
inline |
returns how many finds have been returned so far
◆ finished()
bool StrTokens::finished |
( |
| ) |
const |
|
inline |
have all tokens been returned?
◆ next() [1/2]
std::string StrTokens::next |
( |
| ) |
|
returns the next token, can be the empty string if two tokens follow immediately, or if finished()
◆ next() [2/2]
std::string StrTokens::next |
( |
const std::string & |
_sep | ) |
|
|
inline |
(re)sets the separators, then returns the next token
◆ num
size_t StrTokens::p = std::string::npos |
|
protected |
points to last separator found
const std::string& StrTokens::s |
|
protected |
reference to the string to search
◆ sep
std::string StrTokens::sep |
|
protected |
The documentation for this class was generated from the following files: