10#ifndef CPROVER_UTIL_STRING_UTILS_H
11#define CPROVER_UTIL_STRING_UTILS_H
72 for(
auto it=std::next(
b); it!=e; ++it)
87template <
typename Stream,
typename It,
typename Delimiter>
91 using value_type =
decltype(*b);
94 os,
b, e,
delimiter, [](
const value_type &
x) {
return x; });
99std::string
escape(std::string_view s);
122 const std::string &line,
124 const std::size_t width = 80);
142 const std::string::const_iterator left,
143 const std::string::const_iterator right,
145 const std::size_t width = 80);
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
std::string capitalize(std::string_view s)
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.
std::string escape_non_alnum(std::string_view to_escape)
Replace non-alphanumeric characters with _xx escapes, where xx are hex digits.
std::string wrap_line(const std::string &line, const std::size_t left_margin=0, const std::size_t width=80)
Wrap line at spaces to not extend past the right margin, and include given padding with spaces to the...
std::string trim_from_last_delimiter(std::string_view s, const char delim)
void split_string(std::string_view s, char delim, std::string &left, std::string &right, bool strip=false)
std::string escape(std::string_view s)
Generic escaping of strings; this is not meant to be a particular programming language.
std::string strip_string(std::string_view s)
Remove all whitespace characters from either end of a string.