auto scalar=x::newscalarnode::create("Albuquerque"); scalar->anchor="left_turn_location";
x::yaml::newscalarnode
is a
x::yaml::newnode
that writes a scalar value in a YAML.
The only required parameter is the scalar's value.
LibYAML
document requires the value to use the UTF-8
codeset. Other, optional parameters to the constructor are:
An optional YAML tag handle for this scalar node.
This handle must be included in the
x::yaml::newdocumentnode
's
tags
map.
YAML_ANY_SCALAR_STYLE
(the default),
or any one of other yaml_scalar_style_t
values implemented by
LibYAML.
A flag (true
by default), that specifies whether
the flag may be omitted for the plain formatting style.
A flag (true
by default), that specifies whether
the flag may be omitted for any non-plain formatting style.
There is no parameter for the optional anchor for any subsequent alias references to this scalar object. The anchor needs to be set manually, after constructing the scalar object, as shown in the example above.