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(const(Node) node)
  2. void scalarStyleHack(Node node, ScalarStyle rhs)
    @safe nothrow
    void
    scalarStyleHack
    (,)

Examples

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

Meta