All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Aux::StringTools Namespace Reference

Missing string functions. More...

Functions

template<typename Iterator , typename Character >
std::vector< std::string > split (Iterator begin, Iterator end, Character delim=Character{' '})
 Splits a range of characters at a delimiter into a vector of strings. More...
 
std::vector< std::string > split (const std::string &s, char delim= ' ')
 Split a string at delimiter and return vector of parts. More...
 
bool ends_with (const std::string &str, const std::string &suffix)
 Determines whether str ends with suffix. More...
 
bool starts_with (const std::string &str, const std::string &prefix)
 Determines whether str starts with prefix. More...
 

Detailed Description

Missing string functions.

Function Documentation

bool Aux::StringTools::ends_with ( const std::string &  str,
const std::string &  suffix 
)
inline

Determines whether str ends with suffix.

template<typename Iterator , typename Character >
std::vector<std::string> Aux::StringTools::split ( Iterator  begin,
Iterator  end,
Character  delim = Character{' '} 
)

Splits a range of characters at a delimiter into a vector of strings.

Requirements: Character must be equality-comparable to char and it must be possible to construct a char from any Character. Iterator must be an input-iterator over Characters.

std::vector<std::string> Aux::StringTools::split ( const std::string &  s,
char  delim = ' ' 
)
inline

Split a string at delimiter and return vector of parts.

bool Aux::StringTools::starts_with ( const std::string &  str,
const std::string &  prefix 
)
inline

Determines whether str starts with prefix.