MVE - Multi-View Environment mve-devel
Loading...
Searching...
No Matches
Namespaces | Functions
strings.h File Reference
#include <sstream>
#include <string>
#include <iomanip>
#include <stdexcept>
#include <algorithm>
#include <cstdint>
#include "util/defines.h"
Include dependency graph for strings.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  util
 Parser, tokenizer, timer, smart pointer, threads, etc.
 
namespace  util::string
 String conversions and helper functions.
 

Functions

void util::string::clip_newlines (std::string *str)
 Clips newlines from the end of the string, in-place.
 
void util::string::clip_whitespaces (std::string *str)
 Clips whitespaces from the front and end of the string, in-place.
 
std::string util::string::clipped_newlines (std::string const &str)
 Clips newlines from the end of the string.
 
std::string util::string::clipped_whitespaces (std::string const &str)
 Clips whitespaces from the front and end of the string.
 
template<typename T >
util::string::convert (std::string const &str, bool strict_conversion=true)
 From string to other types conversions.
 
std::string util::string::ellipsize (std::string const &in, std::size_t chars, int type=0)
 Reduces string size by inserting "..." at the end (type = 0), in the middle (type = 1) or at the beginning (type = 2).
 
template<typename T >
char const * util::string::for_type (void)
 String representation for types.
 
template<>
char const * util::string::for_type< double > (void)
 
template<>
char const * util::string::for_type< float > (void)
 
template<>
char const * util::string::for_type< int16_t > (void)
 
template<>
char const * util::string::for_type< int32_t > (void)
 
template<>
char const * util::string::for_type< int64_t > (void)
 
template<>
char const * util::string::for_type< int8_t > (void)
 
template<>
char const * util::string::for_type< uint16_t > (void)
 
template<>
char const * util::string::for_type< uint32_t > (void)
 
template<>
char const * util::string::for_type< uint64_t > (void)
 
template<>
char const * util::string::for_type< uint8_t > (void)
 
template<>
std::string util::string::get (std::string const &value)
 
template<typename T >
std::string util::string::get (T const &value)
 From arbitrary types to string conversion.
 
template<typename T >
std::string util::string::get_digits (T const &value, int digits)
 Returns string with 'digits' of precision.
 
template<typename T >
std::string util::string::get_filled (T const &value, int width, char fill='0')
 Returns a string filled to the left to a length of 'width' chars.
 
template<typename T >
std::string util::string::get_fixed (T const &value, int digits)
 Returns string with 'digits' of fixed precision (fills with zeros).
 
std::string util::string::get_size_string (std::size_t size)
 Returns a string with a human readable byte size, e.g.
 
std::string util::string::left (std::string const &str, std::size_t chars)
 Returns the leftmost 'chars' characters of 'str'.
 
std::string util::string::lowercase (std::string const &str)
 Returns a lower-case version of the string.
 
void util::string::normalize (std::string *str)
 Replaces several whitespaces with a single blank, in-place.
 
std::string util::string::normalized (std::string const &str)
 Replaces several whitespaces with a single blank.
 
void util::string::punctate (std::string *input, char delim=',', std::size_t spacing=3)
 Inserts 'delim' every 'spacing' characters from the right, in-place.
 
std::string util::string::punctated (std::string const &input, char delim=',', std::size_t spacing=3)
 Inserts 'delim' every 'spacing' characters from the right.
 
std::string util::string::right (std::string const &str, std::size_t chars)
 Returns the rightmost 'chars' characters of 'str'.
 
int util::string::size_for_type_string (std::string const &typestring)
 Returns the byte size of given type string (e.g.
 
std::string util::string::uppercase (std::string const &str)
 Returns an upper-case version of the string.
 
std::string util::string::wordwrap (char const *str, int width)
 Inserts line breaks on word boundaries to limit lines to 'width' chars.