Version: SMASH-3.1
stringfunctions.h File Reference
#include <cstdint>
#include <string>
#include <vector>

Go to the source code of this file.

Namespaces

 smash
 
 smash::utf8
 

Functions

std::string smash::trim (const std::string &s)
 Strip leading and trailing whitespaces. More...
 
void smash::remove_substr (std::string &s, const std::string &p)
 Remove all instances of a substring p in a string s. More...
 
void smash::isoclean (std::string &s)
 Remove ⁺, ⁻, ⁰ from string. More...
 
std::vector< std::string > smash::split (const std::string &s, char delim)
 Split string by delimiter. More...
 
std::string smash::join (const std::vector< std::string > &v, const std::string &delim)
 Join strings using delimiter. More...
 
std::string smash::quote (const std::string &s)
 Add quotes around string. More...
 
std::string smash::utf8::fill_left (const std::string &s, size_t width, char fill=' ')
 Fill string with characters to the left until the given width is reached. More...
 
std::string smash::utf8::fill_right (const std::string &s, size_t width, char fill=' ')
 Fill string with characters to the right until the given width is reached. More...
 
std::string smash::utf8::fill_both (const std::string &s, size_t width, char fill=' ')
 Fill string with characters at both sides until the given width is reached. More...
 
template<typename octet_type >
uint8_t smash::utf8::mask8 (octet_type oc)
 Extract the first byte from a given value. More...
 
template<typename octet_iterator >
std::iterator_traits< octet_iterator >::difference_type smash::utf8::sequence_length (octet_iterator lead_it)
 Given an iterator to the beginning of a UTF-8 sequence, return the length of the next UTF-8 code point. More...