configuration::utils Namespace Reference

Functions

size_t tokenizer (const std::string &text, const std::string &delimiters, std::vector< std::string > &tokens)
std::string & trim (std::string &str, const std::string &blankSet)

Function Documentation

size_t configuration::utils::tokenizer ( const std::string &  text,
const std::string &  delimiters,
std::vector< std::string > &  tokens 
)

Parses given text to tokens.

Parameters:
text String to parse.
delimiters Set of delimiters.
tokens Output array of tokens.

One token is considered to be everything between two delimiters (or text start, end respectively). Deliminers are not included. Note that empty string is ignored and not parsed.

Returns:
number of output tokens.

Referenced by configuration::ModeConfigurationParser::parse().

std::string & configuration::utils::trim ( std::string &  str,
const std::string &  blankSet = " \t\n" 
)

Trims given string.

Parameters:
str String to trim.
blankSet Set of blank characters (default value " \t\n").

Removes leading and trailing characters which are in blankSet.

Returns:
reference to trimed str.

Referenced by configuration::StringConfigurationParser::parse(), and configuration::ModeConfigurationParser::parse().