MCPcopy Create free account
hub / github.com/fmtlib/fmt / write_escaped_string

Function write_escaped_string

include/fmt/format.h:1850–1863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1848
1849template <typename Char, typename OutputIt>
1850auto write_escaped_string(OutputIt out, basic_string_view<Char> str)
1851 -> OutputIt {
1852 *out++ = static_cast<Char>('"');
1853 auto begin = str.begin(), end = str.end();
1854 do {
1855 auto escape = find_escape(begin, end);
1856 out = copy<Char>(begin, escape.begin, out);
1857 begin = escape.end;
1858 if (!begin) break;
1859 out = write_escaped_cp<OutputIt, Char>(out, escape);
1860 } while (begin != end);
1861 *out++ = static_cast<Char>('"');
1862 return out;
1863}
1864
1865template <typename Char, typename OutputIt>
1866auto write_escaped_char(OutputIt out, Char v) -> OutputIt {

Callers 1

writeMethod · 0.85

Calls 3

find_escapeFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected