MCPcopy Create free account
hub / github.com/boostorg/histogram / escape_string

Function escape_string

include/boost/histogram/axis/ostream_operators.hpp:27–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template <typename OStream>
27void escape_string(OStream& os, const string_view s) {
28 os << '\'';
29 for (auto sit = s.begin(); sit != s.end(); ++sit) {
30 if (*sit == '\'' && (sit == s.begin() || *(sit - 1) != '\\')) {
31 os << "\\\'";
32 } else {
33 os << *sit;
34 }
35 }
36 os << '\'';
37}
38} // namespace detail
39
40template <typename CharT, typename Traits, typename T>

Callers 2

mainFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by 1

mainFunction · 0.68