collectionStyleHack

Set the collection 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 collection nodes (nodes where node.isScalar() != true).

  1. CollectionStyle collectionStyleHack(ref const(Node) node)
  2. void collectionStyleHack(ref Node node, const CollectionStyle rhs)
    void
    collectionStyleHack
    @safe nothrow

Examples

writeln("D:YAML collectionStyleHack setter unittest");
auto node = Node([1, 2, 3, 4, 5]);
node.collectionStyleHack = CollectionStyle.Block;
assert(node.collectionStyleHack() == CollectionStyle.Block);

Meta