10 #ifndef STRINGUTILS_H_ 11 #define STRINGUTILS_H_ 22 namespace StringUtils {
24 using Tokens = std::vector<std::string>;
47 std::string
Trim(
const std::string &str);
67 bool IsReal(
const std::string &str);
108 template <
typename Container>
109 std::enable_if_t<!(is_pointer<typename Container::value_type>::value), std::string>
FindSimilar(
const std::string &str,
110 const Container &cont);
122 template <
typename Container>
123 std::enable_if_t<is_pointer<typename Container::value_type>::value, std::string>
FindSimilar(
const std::string &str,
124 const Container &cont);
bool ToBoolean(const std::string &str)
Converts a string into a boolean value.
Definition: StringUtils.cpp:124
bool IsGlobExpression(const std::string &str)
Check if the given string is a glob expression.
Definition: StringUtils.cpp:144
Tokens Tokenize(const std::string &str, char delimiter=' ')
Extracts words from a string.
Definition: StringUtils.cpp:17
IncludeFileExc.h IncludeFileExc class declaration.
Definition: Algorithm.h:21
std::string Trim(const std::string &str)
Trims a string.
Definition: StringUtils.cpp:69
std::vector< std::string > Tokens
Definition: StringUtils.h:24
std::string RegexFromGlob(const std::string &str)
Build a regex starting from a glob expression.
Definition: StringUtils.cpp:152
bool IsReal(const std::string &str)
Checks if a string is a real number.
Definition: StringUtils.cpp:92
bool IsInteger(const std::string &str)
Checks if a string is an a integer.
Definition: StringUtils.cpp:80
std::enable_if_t<!(is_pointer< typename Container::value_type >::value), std::string > FindSimilar(const std::string &str, const Container &cont)
Find a similar string inside a container.
Definition: StringUtils.hpp:22