YAML::PullParser
A pull parser allows parsing a YAML document by events.
When creating an instance, the parser is positioned in
the first event. To get the event kind invoke kind.
If the event is a scalar you can invoke value to get
its string value. Other methods like tag, anchor
and scalar_style let you inspect other information from events.
Invoking read_next reads the next event.
Constructors
Creates a parser, yields it to the block, and closes the parser at the end of it.
Instance methods
Returns the mapping style, assuming the pull parser is located at a mapping begin event. Raises otherwise.
Reads a "document start" event, yields to the block, and then reads a "document end" event.
Reads a "mapping start" event, yields to the block, and then reads a "mapping end" event.
Reads a "sequence start" event, yields to the block, and then reads a "sequence end" event.
Reads a "stream start" event, yields to the block, and then reads a "stream end" event.
Returns the scalar style, assuming the pull parser is located at a scalar event. Raises otherwise.
Returns the sequence style, assuming the pull parser is located at a sequence begin event. Raises otherwise.
Returns the scalar value, assuming the pull parser is located at a scalar. Raises otherwise.