XMLWriter.this

In general, it's more user-friendly to use xmlWriter rather than calling the constructor directly, because then the type of the output range can be inferred. However, in the case where a pointer is desirable, then the constructor needs to be called instead of xmlWriter.

  1. this()
  2. this(OR output, string baseIndent)
    struct XMLWriter(OR)
    this
    (,
    string baseIndent = " "
    )
    if (
    isOutputRange!(OR, char)
    )

Parameters

output OR

The _output range that the XML will be written to.

baseIndent string

Optional argument indicating the base indent to be used when an indent is inserted after a newline in the XML (with the actual indent being the base indent inserted once for each level of the tagDepth). The default is four spaces.

Examples

import std.array : Appender, appender;

auto writer = new XMLWriter!(Appender!string)(appender!string());
writer.writeStartTag("root", Newline.no, EmptyTag.yes);
assert(writer.output.data == "<root/>");

See Also

Meta