1#ifndef OPM_UTILITY_STRING_HPP
2#define OPM_UTILITY_STRING_HPP
12template<
typename T,
typename U >
14 const auto up = [](
char c ) {
return std::toupper( c ); };
21 typename std::decay< T >::type
t( std::forward< T >(
x ) );
30 const auto start = ret.find_first_not_of(
" \t\n\r\f\v");
31 if (start == std::string::npos)
34 return ret.substr(start);
43 const auto end = ret.find_last_not_of(
" \t\n\r\f\v");
44 if (
end == std::string::npos)
47 return ret.substr(0,
end + 1);
61 size_t pos =
data.find(toSearch);
64 while (pos != std::string::npos)
67 data.replace(pos, toSearch.size(), replace);
69 pos =
data.find(toSearch, pos + replace.size());
77 std::vector<std::string> result;
79 std::istringstream tokenStream(input);
80 while (std::getline(tokenStream, token, delimiter))
81 result.push_back(token);
90 std::vector<std::string> result;
91 std::string::size_type start = 0;
92 while (start < input.size()) {
93 auto end = input.find_first_of(delimiters, start);
94 if (
end == std::string::npos) {
95 result.push_back(input.substr(start));
96 end = input.size() - 1;
97 }
else if (
end != start)
98 result.push_back(input.substr(start,
end-start));
const char *const string
Definition: cJSON.h:170
std::string trim_copy(const T &s)
Definition: String.hpp:51
std::vector< std::string > split_string(const std::string &input, char delimiter)
Definition: String.hpp:74
std::string rtrim_copy(const T &s)
Definition: String.hpp:39
@ end
Definition: ActionValue.hpp:20
std::string ltrim_copy(const T &s)
Definition: String.hpp:26
void replaceAll(T &data, const T &toSearch, const T &replace)
Definition: String.hpp:58
U & uppercase(const T &src, U &dst)
Definition: String.hpp:13
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t t(t+t)") define_sfop3(16
x y t t *t x y t t t x y t t t x *y t *t t x *y t *t t x y t t t x y t t t x(y+z)