YAML parser

template<typename HandlerT>
class yaml_parser : public orcus::yaml::parser_base

Parser for YAML documents.

Warning

This parser is still highly experimental. Use with caution.

Template Parameters:

HandlerT – Hanlder type with member functions for event callbacks. Refer to yaml_handler.

Public Types

typedef HandlerT handler_type

Public Functions

yaml_parser(std::string_view content, handler_type &hdl)
void parse()

Parser Handler

class yaml_handler

Blank handler class for yaml_parser. One can sub-class this and overwrite callback functions one needs to handle.

Public Functions

inline void begin_parse()

Called when the parser starts parsing a content.

inline void end_parse()

Called when the parser finishes parsing an entire content.

inline void begin_document()

Called when a new document is encountered.

inline void end_document()

Called when the parser has finished parsing a document.

inline void begin_sequence()

Called when a sequence begins.

inline void end_sequence()

Called when a sequence ends.

inline void begin_map()

Called when a map begins.

inline void begin_map_key()

Called when the parser starts parsing a map key.

inline void end_map_key()

Called when the parser finishes parsing a map key.

inline void end_map()

Called when the parser finishes parsing an entire map.

inline void string(std::string_view value)

Called when a string value is encountered.

Parameters:

value – string value.

inline void number(double val)

Called when a numeric value is encountered.

Parameters:

val – numeric value.

inline void boolean_true()

Called when a boolean ‘true’ keyword is encountered.

inline void boolean_false()

Called when a boolean ‘false’ keyword is encountered.

inline void null()

Called when a ‘null’ keyword is encountered.