multiTypeString

Notes: Anything in "data" must be doubly escaped.

For instance, if you want the generated function to return newline (ie, "\n"), then "data" must be ['\\', 'n'], and thus the mixin call would look like this:

mixin(multiTypeString("unixNewline", "\\n"));
// Or
mixin(multiTypeString("unixNewline", r"\n"));

Or, if you want the generated function to return the escape sequence for newline (ie, r"\n", or "\\n", or ['\\', 'n']), then "data" must be ['\\', '\\', 'n'], and thus the mixin call would look like this:

mixin(multiTypeString("unixNewlineEscSequence", "\\\\n"));
// Or
mixin(multiTypeString("unixNewlineEscSequence", r"\\n"));

(This requirement could be changed if there is a way to automatically escape a string at compile-time.)

template multiTypeString (
string name
string data
string access = "public"
) {}

Members

Manifest constants

multiTypeString
enum multiTypeString;
Undocumented in source.

Meta