printEscaped

Note: Non-ASCII Unicode characters are encoded as sequence of \xXX bytes. This may be fixed in the future.

pragma(inline, false) ref
W
printEscaped
(
C = char
W
)
(
scope return ref W w
,
scope const(char)[] str
)

Examples

import mir.appender: ScopedBuffer;
ScopedBuffer!char w;
assert(w.printEscaped("Hi\t" ~ `"@nogc"`).data == `"Hi\t\"@nogc\""`, w.data);
w.reset;
assert(w.printEscaped("\xF3").data == `"\xF3"`, w.data);

Meta