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

Examples

// Node node // loaded from a file
if(node.isScalar)
{
    import std.stdio;
    writeln(node.scalarStyleHack());
}

Meta