Apache Mesos
Namespaces | Enumerations | Functions | Variables
strings.hpp File Reference
#include <algorithm>
#include <cstring>
#include <map>
#include <sstream>
#include <string>
#include <vector>
#include "foreach.hpp"
#include "format.hpp"
#include "option.hpp"
#include "stringify.hpp"

Go to the source code of this file.

Namespaces

 strings
 
 strings::internal
 

Enumerations

enum  strings::Mode { strings::PREFIX, strings::SUFFIX, strings::ANY }
 

Functions

std::string strings::remove (const std::string &from, const std::string &substring, Mode mode=ANY)
 
std::string strings::trim (const std::string &from, Mode mode=ANY, const std::string &chars=WHITESPACE)
 
std::string strings::trim (const std::string &from, const std::string &chars)
 
std::string strings::replace (const std::string &s, const std::string &from, const std::string &to)
 
std::vector< std::string > strings::tokenize (const std::string &s, const std::string &delims, const Option< size_t > &maxTokens=None())
 
std::vector< std::string > strings::split (const std::string &s, const std::string &delims, const Option< size_t > &maxTokens=None())
 
std::map< std::string, std::vector< std::string > > strings::pairs (const std::string &s, const std::string &delims1, const std::string &delims2)
 
std::stringstream & strings::internal::append (std::stringstream &stream, const std::string &value)
 
std::stringstream & strings::internal::append (std::stringstream &stream, std::string &&value)
 
std::stringstream & strings::internal::append (std::stringstream &stream, const char *&&value)
 
template<typename T >
std::stringstream & strings::internal::append (std::stringstream &stream, T &&value)
 
template<typename T >
std::stringstream & strings::internal::join (std::stringstream &stream, const std::string &separator, T &&tail)
 
template<typename THead , typename... TTail>
std::stringstream & strings::internal::join (std::stringstream &stream, const std::string &separator, THead &&head, TTail &&...tail)
 
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)
 
template<typename Iterable >
std::string strings::join (const std::string &separator, const Iterable &i)
 
bool strings::checkBracketsMatching (const std::string &s, const char openBracket, const char closeBracket)
 
bool strings::startsWith (const std::string &s, const std::string &prefix)
 
bool strings::startsWith (const std::string &s, const char *prefix)
 
bool strings::startsWith (const std::string &s, char c)
 
bool strings::endsWith (const std::string &s, const std::string &suffix)
 
bool strings::endsWidth (const std::string &s, const char *suffix)
 
bool strings::endsWith (const std::string &s, char c)
 
bool strings::contains (const std::string &s, const std::string &substr)
 
std::string strings::lower (const std::string &s)
 
std::string strings::upper (const std::string &s)
 

Variables

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