Escaping chars in a less shitty, but actually compiling, way
This commit is contained in:
parent
ce4d81b387
commit
a740236988
@ -1693,9 +1693,15 @@ auto write_escaped_string(OutputIt out, basic_string_view<char> str) -> OutputIt
|
|||||||
|
|
||||||
template <typename Char, typename OutputIt>
|
template <typename Char, typename OutputIt>
|
||||||
auto write_escaped_char(OutputIt out, Char v) -> OutputIt {
|
auto write_escaped_char(OutputIt out, Char v) -> OutputIt {
|
||||||
|
*out++ = v;
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename OutputIt>
|
||||||
|
auto write_escaped_char(OutputIt out, char v) -> OutputIt {
|
||||||
*out++ = '\'';
|
*out++ = '\'';
|
||||||
if (needs_escape(v) && v != '"' || v == '\'') {
|
if ((needs_escape(v) && v != '"') || v == '\'') {
|
||||||
out = write_escaped_cp(out, find_escape_result<Char>{
|
out = write_escaped_cp(out, find_escape_result<char>{
|
||||||
&v, &v+1, static_cast<uint32_t>(v)
|
&v, &v+1, static_cast<uint32_t>(v)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user