ShlubluLib
v0.5
ShlubluLib is a lightweight, modular, general purpose, open-source C++ library for Linux and Windows.
|
Go to the documentation of this file.
35 inline std::string
xtos(T arg)
37 static_assert(std::is_arithmetic<T>::value || std::is_pointer<T>::value,
"Type should be either arithmetic or pointer.");
39 std::ostringstream buffer;
60 static_assert(std::is_floating_point<T>::value,
"Type should be floating point.");
62 std::ostringstream buffer;
84 std::vector<std::string>
const &
split(std::string
const& s,
char delim, std::vector<std::string>& elems);
98 std::vector<std::string>
split(std::string
const& s,
char delim);
143 std::string&
trim(std::string& s);
160 std::string&
replace(std::string& source, std::string
const& find, std::string
const& replaceBy);
188 std::string
lower(std::string
const& s);
216 std::string
upper(std::string
const& s);
std::string fromWString(std::wstring const &wstr)
Returns a string version of the given UTF-8 wstring.
std::string xtofs(T arg)
Converts floating point values to std::string in fixed notation.
Definition: String.h:58
std::wstring toWString(std::string const &str)
Returns an UTF-8 wstring version of the given string.
std::string & rtrim(std::string &s)
Trims the trailing blank characters of a string.
std::string & trim(std::string &s)
Trims the leading and trailing blank characters of a string.
std::string & replace(std::string &source, std::string const &find, std::string const &replaceBy)
Replaces all occurences of a substring in a string.
std::string & lower(std::string &s)
Converts a string to lowercase.
std::string xtos(T arg)
Converts arithmetic values or pointers to std::string.
Definition: String.h:35
std::vector< std::string > const & split(std::string const &s, char delim, std::vector< std::string > &elems)
Splits a string delimited by a given character and stores the substrings in the given target vector.
size_t levenshteinDistance(std::string const &s, std::string const &t)
Computes the Levenshtein distance between two strings.
std::string & ltrim(std::string &s)
Trims the leading blank characters of a string.
std::string & upper(std::string &s)
Converts a string to uppercase.