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

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