Node.this

Construct a node from an associative _array.

If keys and/or values of _array are nodes, they stored directly. Otherwise they are converted to nodes and then stored.

Parameters

tag
Type: string

Overrides tag of the node when emitted, regardless of tag determined by Representer. Representer uses this to determine YAML data type when a D data type maps to multiple different YAML data types. This is used to differentiate between YAML unordered mappings ("!!map"), ordered mappings ("!!omap"), and pairs ("!!pairs") which are all internally represented as an _array of node pairs. Tag must be in full form, e.g. "tag:yaml.org,2002:omap", not a shortcut, like "!!omap".

Examples

1 // Will be emitted as an unordered mapping (default for mappings)
2 auto map   = Node([1 : "a", 2 : "b"]);
3 // Will be emitted as an ordered map (overriden tag)
4 auto omap  = Node([1 : "a", 2 : "b"], "tag:yaml.org,2002:omap");
5 // Will be emitted as pairs (overriden tag)
6 auto pairs = Node([1 : "a", 2 : "b"], "tag:yaml.org,2002:pairs");

Meta