49#ifndef GUM_UTILS_STRING_H
50#define GUM_UTILS_STRING_H
76 GUM_SHARED_PUBLIC std::string
toLower(std::string_view str);
84 GUM_SHARED_PUBLIC
bool contains(std::string_view s, std::string_view needle);
90 GUM_SHARED_PUBLIC
bool endsWith(
const std::string_view& value,
const std::string_view& ending);
98 GUM_SHARED_PUBLIC std::vector< std::string >
split(std::string_view orig,
99 std::string_view delimiter);
108 GUM_SHARED_PUBLIC std::string
109 replace(std::string_view s, std::string_view val, std::string_view new_val);
116 GUM_SHARED_PUBLIC
bool isInteger(std::string_view val);
130 GUM_SHARED_PUBLIC
bool isNumerical(std::string_view val);
144 GUM_SHARED_PUBLIC
void ltrim(std::string& s);
150 GUM_SHARED_PUBLIC
void rtrim(std::string& s);
156 GUM_SHARED_PUBLIC
void trim(std::string& s);
163 GUM_SHARED_PUBLIC std::string
trim_copy(std::string_view s);
172 template <
typename T >
bool isNumericalWithResult(std::string_view val, double *res)
return true is a string contains a numerical (double) value
GUM_SHARED_PUBLIC bool contains(std::string_view s, std::string_view needle)
true if needle in s
GUM_SHARED_PUBLIC std::string remove_newline(std::string_view s)
remove all newlines in a string
GUM_SHARED_PUBLIC std::string toLower(std::string_view str)
Returns the lowercase version of str.
bool isIntegerWithResult(std::string_view val, int *res)
return true is a string contains an integer value
std::string compact_tostr(T value)
Returns a path to a unique file name.
GUM_SHARED_PUBLIC void ltrim(std::string &s)
trim from start (in place)
GUM_SHARED_PUBLIC std::string trim_copy(std::string_view s)
trim from both ends (copying)
GUM_SHARED_PUBLIC bool isInteger(std::string_view val)
return true is a string contains an integer value
bool endsWith(const std::string_view &value, const std::string_view &ending)
Returns true if value ends with ending.
GUM_SHARED_PUBLIC void trim(std::string &s)
trim from both ends (in place)
GUM_SHARED_PUBLIC bool isNumerical(std::string_view val)
return true is a string contains a numerical (double) value
std::string getUniqueFileName()
Returns a path to a unique file name.
GUM_SHARED_PUBLIC void rtrim(std::string &s)
trim from end (in place)
std::string replace(std::string_view s, std::string_view val, std::string_view new_val)
Replace val by new_val in s.
std::vector< std::string > split(std::string_view str, std::string_view delim)
Split str using the delimiter.
gum is the global namespace for all aGrUM entities
Contains useful methods for random stuff.