#include <Puma/SimpleParser.h>
Simple string tokenizer taking a string and providing a list of the tokens recognized.
|
static std::string | strip (const std::string &str) |
| Remove enclosing double-quotes from a string.
|
|
static int | tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ") |
| Splits a given string into tokens recognized by the given delimiters.
|
|
◆ strip()
static std::string Puma::SimpleParser::strip |
( |
const std::string & | str | ) |
|
|
static |
Remove enclosing double-quotes from a string.
- Parameters
-
- Returns
- String without the enclosing double-quotes.
◆ tokenize()
static int Puma::SimpleParser::tokenize |
( |
const std::string & | str, |
|
|
std::vector< std::string > & | tokens, |
|
|
const std::string & | delimiters = " " ) |
|
static |
Splits a given string into tokens recognized by the given delimiters.
- Parameters
-
str | The string to split. |
tokens | The container for the resulting tokens. |
delimiters | A string with the delimiters. Defaults to a single space. |
- Returns
- Number of recognized tokens.