scalarStyleHack

Get the scalar style a node had in the file it was loaded from.

This is only useful for nodes loaded from files.

This is a "hack" because a YAML application is supposed to be unaware of styles used in YAML styles, i.e. treating different styles differently is unstandard. However, determining style may be useful in some cases, e.g. YAML utilities.

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

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

Examples

1 // Node node // loaded from a file
2 if(node.isScalar)
3 {
4    import std.stdio;
5    writeln(node.scalarStyleHack());
6 }

Meta