PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::SimpleParser Class Reference

#include <Puma/SimpleParser.h>

+ Inheritance diagram for Puma::SimpleParser:

Description

Simple string tokenizer taking a string and providing a list of the tokens recognized.

Static Public Member Functions

static std::string strip (const std::string &str)
 Remove enclosing double-quotes from a string. More...
 
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. More...
 

Member Function Documentation

◆ strip()

static std::string Puma::SimpleParser::strip ( const std::string &  str)
static

Remove enclosing double-quotes from a string.

Parameters
strThe string to strip.
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
strThe string to split.
tokensThe container for the resulting tokens.
delimitersA string with the delimiters. Defaults to a single space.
Returns
Number of recognized tokens.