YAML Parser

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

Public Types

typedef _Handler handler_type

Public Functions

yaml_parser(const char *p, size_t n, handler_type &hdl)
void parse()

Parser Handler

class yaml_parser_handler

Public Functions

void begin_parse()

Called when the parser starts parsing a content.

void end_parse()

Called when the parser finishes parsing an entire content.

void begin_document()

Called when a new document is encountered.

void end_document()

Called when the parser has finished parsing a document.

void begin_sequence()

Called when a sequence begins.

void end_sequence()

Called when a sequence ends.

void begin_map()

Called when a map begins.

void begin_map_key()

Called when the parser starts parsing a map key.

void end_map_key()

Called when the parser finishes parsing a map key.

void end_map()

Called when the parser finishes parsing an entire map.

void string(const char *p, size_t n)

Called when a string value is encountered.

Parameters
  • p: pointer to the first character of the string value.
  • len: length of the string value.

void number(double val)

Called when a numeric value is encountered.

Parameters
  • val: numeric value.

void boolean_true()

Called when a boolean ‘true’ keyword is encountered.

void boolean_false()

Called when a boolean ‘false’ keyword is encountered.

void null()

Called when a ‘null’ keyword is encountered.