Dumper.tagDirectives

Specify tag directives.

A tag directive specifies a shorthand notation for specifying _tags. Each tag directive associates a handle with a prefix. This allows for compact tag notation.

Each handle specified MUST start and end with a '!' character (a single character "!" handle is allowed as well).

Only alphanumeric characters, '-', and '__' may be used in handles.

Each prefix MUST not be empty.

The "!!" handle is used for default YAML _tags with prefix "tag:yaml.org,2002:". This can be overridden.

struct Dumper
@property
void
tagDirectives
pure @trusted
(
string[string] tags
)

Examples

1 Dumper dumper = Dumper("file.yaml");
2 string[string] directives;
3 directives["!short!"] = "tag:long.org,2011:";
4 //This will emit tags starting with "tag:long.org,2011"
5 //with a "!short!" prefix instead.
6 dumper.tagDirectives(directives);
7 dumper.dump(Node("foo"));

Meta