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