scalarStyleHack

Set the scalar style node should have when written to a file.

Setting the style might be useful when generating YAML or reformatting existing files.

May only be called on scalar nodes (nodes where node.isScalar() == true).

  1. ScalarStyle scalarStyleHack(ref const(Node) node)
  2. void scalarStyleHack(ref Node node, const ScalarStyle rhs)
    void
    scalarStyleHack
    @safe nothrow
    ()

Examples

writeln("D:YAML scalarStyleHack setter unittest");
auto node = Node(5);
node.scalarStyleHack = ScalarStyle.DoubleQuoted;
assert(node.scalarStyleHack() == ScalarStyle.DoubleQuoted);

Meta