Go to the documentation of this file.
10 #ifndef CPROVER_UTIL_STRING_UTILS_H
11 #define CPROVER_UTIL_STRING_UTILS_H
35 "use split_string(s, delim, strip, remove_empty) instead"))
39 std::vector<std::
string> &result,
41 bool remove_empty = false);
54 bool remove_empty = false);
74 typename TransformFunc>
79 const Delimiter &delimiter,
80 TransformFunc &&transform_func)
86 os << transform_func(*b);
87 for(
auto it=std::next(b); it!=e; ++it)
89 os << delimiter << transform_func(*it);
102 template <
typename Stream,
typename It,
typename Delimiter>
104 join_strings(Stream &&os,
const It b,
const It e,
const Delimiter &delimiter)
106 using value_type = decltype(*b);
109 os, b, e, delimiter, [](
const value_type &x) {
return x; });
114 std::string
escape(
const std::string &);
std::string escape(const std::string &)
Generic escaping of strings; this is not meant to be a particular programming language.
Stream & join_strings(Stream &&os, const It b, const It e, const Delimiter &delimiter, TransformFunc &&transform_func)
Prints items to an stream, separated by a constant delimiter.
#define SINCE(year, month, day, msg)
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip=false, bool remove_empty=false)
Given a string s, split into a sequence of substrings when separated by specified delimiter.
std::string trim_from_last_delimiter(const std::string &s, const char delim)
std::string escape_non_alnum(const std::string &to_escape)
Replace non-alphanumeric characters with _xx escapes, where xx are hex digits.
std::string strip_string(const std::string &s)
Remove all whitespace characters from either end of a string.