dyaml.event

YAML events. Code based on PyYAML: http://www.pyyaml.org

Types 8

enumEventID : ubyte

Event types.

invalid = 0Invalid (uninitialized) event.
streamStartStream start
streamEndStream end
documentStartDocument start
documentEndDocument end
alias_Alias
scalarScalar
sequenceStartSequence start
sequenceEndSequence end
mappingStartMapping start
mappingEndMapping end
structEvent

YAML event produced by parser.

48 bytes on 64bit.

Fields
string valueValue of the event, if any.
Mark startMarkStart position of the event in file/stream.
Mark endMarkEnd position of the event in file/stream.
EventID idEvent type.
ScalarStyle scalarStyleStyle of scalar event, if this is a scalar event.
bool implicitShould the tag be implicitly resolved?
CollectionStyle collectionStyleCollection style, if this is a SequenceStart or MappingStart.
Methods
int opCmp(ref Event) @disable
bool isNull() @property const pure @safe nothrowIs this a null (uninitialized) event?
string idString() @property const @safeGet string representation of the token ID.
auto ref anchor() inout @trusted pure
auto ref tag() inout @trusted pure
auto ref tagDirectives() inout @trusted pure
void toString(W)(ref W writer) const
aliasstreamEndEvent = event!(EventID.streamEnd)

Aliases for simple events.

aliasaliasEvent = event!(EventID.alias_)
aliassequenceEndEvent = event!(EventID.sequenceEnd)
aliasmappingEndEvent = event!(EventID.mappingEnd)
aliassequenceStartEvent = collectionStartEvent!(EventID.sequenceStart)

Aliases for collection start events.

aliasmappingStartEvent = collectionStartEvent!(EventID.mappingStart)

Functions 6

fnEvent event(EventID id)(const Mark start, const Mark end, const string anchor = null) @safeConstruct a simple event.
fnEvent collectionStartEvent(EventID id)(const Mark start, const Mark end, const string anchor, const string tag, const bool implicit, const CollectionStyle style) pure @safe nothrowConstruct a collection (mapping or sequence) start event.
fnEvent streamStartEvent(const Mark start, const Mark end) pure @safe nothrowConstruct a stream start event.
fnEvent documentStartEvent(const Mark start, const Mark end, const bool explicit, string YAMLVersion, TagDirective[] tagDirectives) pure @safe nothrowConstruct a document start event.
fnEvent documentEndEvent(const Mark start, const Mark end, const bool explicit) pure @safe nothrowConstruct a document end event.
fnEvent scalarEvent(const Mark start, const Mark end, const string anchor, const string tag, const bool implicit, const string value, const ScalarStyle style = ScalarStyle.invalid) @safe pure nothrow @nogcConstruct a scalar event.