Representer

Represents YAML nodes as scalar, sequence and mapping nodes ready for output.

This class is used to add support for dumping of custom data types.

It can also override default node formatting styles for output.

Constructors

this
this(Flag!"useDefaultRepresenters" useDefaultRepresenters)

Construct a Representer.

Destructor

~this
~this()

Destroy the Representer.

Members

Functions

addRepresenter
void addRepresenter(Node function(ref Node, Representer) representer)

Add a function to represent nodes with a specific data type.

opCmp
int opCmp(Representer )
Undocumented in source.
opEquals
bool opEquals(Representer )
Undocumented in source.
represent
void represent(Serializer serializer, Node node)
Undocumented in source. Be warned that the author may not have intended to support it.
representData
Node representData(Node data)
Undocumented in source. Be warned that the author may not have intended to support it.
representMapping
Node representMapping(string tag, Node.Pair[] pairs, CollectionStyle style)

Represent a mapping with specified _tag, representing children first.

representScalar
Node representScalar(string tag, string scalar, ScalarStyle style)

Represent a _scalar with specified _tag.

representSequence
Node representSequence(string tag, Node[] sequence, CollectionStyle style)

Represent a _sequence with specified _tag, representing children first.

Properties

defaultCollectionStyle
CollectionStyle defaultCollectionStyle [@property setter]

Set default _style for collections. If style is CollectionStyle.Invalid, the _style is chosen automatically.

defaultScalarStyle
ScalarStyle defaultScalarStyle [@property setter]

Set default _style for scalars. If style is ScalarStyle.Invalid, the _style is chosen automatically.

Meta