Apache Mesos
Namespaces | Enumerations | Functions | Variables
strings Namespace Reference

Namespaces

 internal
 

Enumerations

enum  Mode { PREFIX, SUFFIX, ANY }
 

Functions

template<typename... T>
Try< std::string > format (const std::string &s, const T &...t)
 
std::string remove (const std::string &from, const std::string &substring, Mode mode=ANY)
 
std::string trim (const std::string &from, Mode mode=ANY, const std::string &chars=WHITESPACE)
 
std::string trim (const std::string &from, const std::string &chars)
 
std::string replace (const std::string &s, const std::string &from, const std::string &to)
 
std::vector< std::string > tokenize (const std::string &s, const std::string &delims, const Option< size_t > &maxTokens=None())
 
std::vector< std::string > split (const std::string &s, const std::string &delims, const Option< size_t > &maxTokens=None())
 
std::map< std::string, std::vector< std::string > > pairs (const std::string &s, const std::string &delims1, const std::string &delims2)
 
template<typename... T>
std::stringstream & join (std::stringstream &stream, const std::string &separator, T &&...args)
 
template<typename THead1 , typename THead2 , typename... TTail>
std::string join (const std::string &separator, THead1 &&head1, THead2 &&head2, TTail &&...tail)
 
std::string join (const std::string &seperator, const std::string &s)
 
template<typename Iterable >
std::string join (const std::string &separator, const Iterable &i)
 
bool checkBracketsMatching (const std::string &s, const char openBracket, const char closeBracket)
 
bool startsWith (const std::string &s, const std::string &prefix)
 
bool startsWith (const std::string &s, const char *prefix)
 
bool startsWith (const std::string &s, char c)
 
bool endsWith (const std::string &s, const std::string &suffix)
 
bool endsWidth (const std::string &s, const char *suffix)
 
bool endsWith (const std::string &s, char c)
 
bool contains (const std::string &s, const std::string &substr)
 
std::string lower (const std::string &s)
 
std::string upper (const std::string &s)
 

Variables

const std::string WHITESPACE = " \t\n\r"
 

Enumeration Type Documentation

Enumerator
PREFIX 
SUFFIX 
ANY 

Function Documentation

bool strings::checkBracketsMatching ( const std::string &  s,
const char  openBracket,
const char  closeBracket 
)
inline
bool strings::contains ( const std::string &  s,
const std::string &  substr 
)
inline
bool strings::endsWidth ( const std::string &  s,
const char *  suffix 
)
inline
bool strings::endsWith ( const std::string &  s,
const std::string &  suffix 
)
inline
bool strings::endsWith ( const std::string &  s,
char  c 
)
inline
template<typename... T>
Try<std::string> strings::format ( const std::string &  s,
const T &...  t 
)
template<typename... T>
std::stringstream& strings::join ( std::stringstream &  stream,
const std::string &  separator,
T &&...  args 
)
template<typename THead1 , typename THead2 , typename... TTail>
std::string strings::join ( const std::string &  separator,
THead1 &&  head1,
THead2 &&  head2,
TTail &&...  tail 
)
std::string strings::join ( const std::string &  seperator,
const std::string &  s 
)
inline
template<typename Iterable >
std::string strings::join ( const std::string &  separator,
const Iterable &  i 
)
inline
std::string strings::lower ( const std::string &  s)
inline
std::map<std::string, std::vector<std::string> > strings::pairs ( const std::string &  s,
const std::string &  delims1,
const std::string &  delims2 
)
inline
std::string strings::remove ( const std::string &  from,
const std::string &  substring,
Mode  mode = ANY 
)
inline
std::string strings::replace ( const std::string &  s,
const std::string &  from,
const std::string &  to 
)
inline
std::vector<std::string> strings::split ( const std::string &  s,
const std::string &  delims,
const Option< size_t > &  maxTokens = None() 
)
inline
bool strings::startsWith ( const std::string &  s,
const std::string &  prefix 
)
inline
bool strings::startsWith ( const std::string &  s,
const char *  prefix 
)
inline
bool strings::startsWith ( const std::string &  s,
char  c 
)
inline
std::vector<std::string> strings::tokenize ( const std::string &  s,
const std::string &  delims,
const Option< size_t > &  maxTokens = None() 
)
inline
std::string strings::trim ( const std::string &  from,
Mode  mode = ANY,
const std::string &  chars = WHITESPACE 
)
inline
std::string strings::trim ( const std::string &  from,
const std::string &  chars 
)
inline
std::string strings::upper ( const std::string &  s)
inline

Variable Documentation

const std::string strings::WHITESPACE = " \t\n\r"