rapidyaml  0.16.0
parseandemitYAML,anddoitfast
Parse in place with temporary parser

parse a mutable YAML source buffer. More...

Functions

void c4::yml::parse_in_place (csubstr filename, substr yaml, Tree *t, id_type node_id, ParserOptions const &opts={})
 (1) parse YAML into an existing tree node. The filename will be used in any error messages arising during the parse. More...
 
void c4::yml::parse_in_place (substr yaml, Tree *t, id_type node_id, ParserOptions const &opts={})
 (2) like (1) but no filename will be reported More...
 
void c4::yml::parse_in_place (csubstr filename, substr yaml, Tree *t, ParserOptions const &opts={})
 (3) parse YAML into an existing tree, into its root node. More...
 
void c4::yml::parse_in_place (substr yaml, Tree *t, ParserOptions const &opts={})
 (4) like (3) but no filename will be reported More...
 
void c4::yml::parse_in_place (csubstr filename, substr yaml, NodeRef node, ParserOptions const &opts={})
 (5) like (1) but the node is given as a NodeRef More...
 
void c4::yml::parse_in_place (substr yaml, NodeRef node, ParserOptions const &opts={})
 (6) like (5) but no filename will be reported More...
 
Tree c4::yml::parse_in_place (csubstr filename, substr yaml, ParserOptions const &opts={})
 (7) create a new tree, and parse YAML into its root node. More...
 
Tree c4::yml::parse_in_place (substr yaml, ParserOptions const &opts={})
 (8) like (7) but no filename will be reported More...
 
void c4::yml::parse_json_in_place (csubstr filename, substr json, Tree *t, id_type node_id, ParserOptions const &opts={})
 (1) parse JSON into an existing tree node. The filename will be used in any error messages arising during the parse. More...
 
void c4::yml::parse_json_in_place (substr json, Tree *t, id_type node_id, ParserOptions const &opts={})
 (2) like (1) but no filename will be reported More...
 
void c4::yml::parse_json_in_place (csubstr filename, substr json, Tree *t, ParserOptions const &opts={})
 (3) parse JSON into an existing tree, into its root node. More...
 
void c4::yml::parse_json_in_place (substr json, Tree *t, ParserOptions const &opts={})
 (4) like (3) but no filename will be reported More...
 
void c4::yml::parse_json_in_place (csubstr filename, substr json, NodeRef node, ParserOptions const &opts={})
 (5) like (1) but the node is given as a NodeRef More...
 
void c4::yml::parse_json_in_place (substr json, NodeRef node, ParserOptions const &opts={})
 (6) like (5) but no filename will be reported More...
 
Tree c4::yml::parse_json_in_place (csubstr filename, substr json, ParserOptions const &opts={})
 (7) create a new tree, and parse JSON into its root node. More...
 
Tree c4::yml::parse_json_in_place (substr json, ParserOptions const &opts={})
 (8) like (7) but no filename will be reported More...
 

Detailed Description

parse a mutable YAML source buffer.

Scalars requiring filtering are mutated in place (except in the rare cases where the filtered scalar is longer than the original scalar).

Note
These freestanding functions use a temporary parser object, and are convenience functions to enable the user to easily parse YAML without the need to explicitly instantiate a parser and event handler. Note that some properties (notably node locations in the original source code) are only available through the parser class. If you need access to any of these properties, use the appropriate overload from Parse in place with existing parser

Function Documentation

void c4::yml::parse_in_place ( csubstr  filename,
substr  yaml,
Tree *  tree,
id_type  node_id,
ParserOptions const &  opts 
)

(1) parse YAML into an existing tree node. The filename will be used in any error messages arising during the parse.

Definition at line 175 of file parse.cpp.

175 { check_(tree); TmpParser tmp(tree, opts); parse_yaml_(&tmp.parser, filename, yaml, tree, node_id); }
void c4::yml::parse_in_place ( substr  yaml,
Tree *  tree,
id_type  node_id,
ParserOptions const &  opts 
)

(2) like (1) but no filename will be reported

Definition at line 176 of file parse.cpp.

176 { check_(tree); TmpParser tmp(tree, opts); parse_yaml_(&tmp.parser, {} , yaml, tree, node_id); }
void c4::yml::parse_in_place ( csubstr  filename,
substr  yaml,
Tree *  tree,
ParserOptions const &  opts 
)

(3) parse YAML into an existing tree, into its root node.

Definition at line 177 of file parse.cpp.

177 { check_(tree); TmpParser tmp(tree, opts); parse_yaml_(&tmp.parser, filename, yaml, tree, tree->root_id()); }
void c4::yml::parse_in_place ( substr  yaml,
Tree *  tree,
ParserOptions const &  opts 
)

(4) like (3) but no filename will be reported

Definition at line 178 of file parse.cpp.

178 { check_(tree); TmpParser tmp(tree, opts); parse_yaml_(&tmp.parser, {} , yaml, tree, tree->root_id()); }
void c4::yml::parse_in_place ( csubstr  filename,
substr  yaml,
NodeRef  node,
ParserOptions const &  opts 
)

(5) like (1) but the node is given as a NodeRef

Definition at line 179 of file parse.cpp.

179 { check_(node); TmpParser tmp(node, opts); parse_yaml_(&tmp.parser, filename, yaml, node.tree(), node.id()); }
void c4::yml::parse_in_place ( substr  yaml,
NodeRef  node,
ParserOptions const &  opts 
)

(6) like (5) but no filename will be reported

Definition at line 180 of file parse.cpp.

180 { check_(node); TmpParser tmp(node, opts); parse_yaml_(&tmp.parser, {} , yaml, node.tree(), node.id()); }
Tree c4::yml::parse_in_place ( csubstr  filename,
substr  yaml,
ParserOptions const &  opts 
)

(7) create a new tree, and parse YAML into its root node.

Definition at line 181 of file parse.cpp.

181 { TmpParser tmp(opts); Tree tree; parse_yaml_(&tmp.parser, filename, yaml, &tree, tree.root_id()); return tree; }
Tree c4::yml::parse_in_place ( substr  yaml,
ParserOptions const &  opts 
)

(8) like (7) but no filename will be reported

Definition at line 182 of file parse.cpp.

182 { TmpParser tmp(opts); Tree tree; parse_yaml_(&tmp.parser, {} , yaml, &tree, tree.root_id()); return tree; }
void c4::yml::parse_json_in_place ( csubstr  filename,
substr  json,
Tree *  tree,
id_type  node_id,
ParserOptions const &  opts 
)

(1) parse JSON into an existing tree node. The filename will be used in any error messages arising during the parse.

Definition at line 197 of file parse.cpp.

197 { check_(tree); TmpParser tmp(tree, opts); parse_json_(&tmp.parser, filename, json, tree, node_id); }
void c4::yml::parse_json_in_place ( substr  json,
Tree *  tree,
id_type  node_id,
ParserOptions const &  opts 
)

(2) like (1) but no filename will be reported

Definition at line 198 of file parse.cpp.

198 { check_(tree); TmpParser tmp(tree, opts); parse_json_(&tmp.parser, {} , json, tree, node_id); }
void c4::yml::parse_json_in_place ( csubstr  filename,
substr  json,
Tree *  tree,
ParserOptions const &  opts 
)

(3) parse JSON into an existing tree, into its root node.

Definition at line 199 of file parse.cpp.

199 { check_(tree); TmpParser tmp(tree, opts); parse_json_(&tmp.parser, filename, json, tree, tree->root_id()); }
void c4::yml::parse_json_in_place ( substr  json,
Tree *  tree,
ParserOptions const &  opts 
)

(4) like (3) but no filename will be reported

Definition at line 200 of file parse.cpp.

200 { check_(tree); TmpParser tmp(tree, opts); parse_json_(&tmp.parser, {} , json, tree, tree->root_id()); }
void c4::yml::parse_json_in_place ( csubstr  filename,
substr  json,
NodeRef  node,
ParserOptions const &  opts 
)

(5) like (1) but the node is given as a NodeRef

Definition at line 201 of file parse.cpp.

201 { check_(node); TmpParser tmp(node, opts); parse_json_(&tmp.parser, filename, json, node.tree(), node.id()); }
void c4::yml::parse_json_in_place ( substr  json,
NodeRef  node,
ParserOptions const &  opts 
)

(6) like (5) but no filename will be reported

Definition at line 202 of file parse.cpp.

202 { check_(node); TmpParser tmp(node, opts); parse_json_(&tmp.parser, {} , json, node.tree(), node.id()); }
Tree c4::yml::parse_json_in_place ( csubstr  filename,
substr  json,
ParserOptions const &  opts 
)

(7) create a new tree, and parse JSON into its root node.

Definition at line 203 of file parse.cpp.

203 { TmpParser tmp(opts); Tree tree; parse_json_(&tmp.parser, filename, json, &tree, tree.root_id()); return tree; }
Tree c4::yml::parse_json_in_place ( substr  json,
ParserOptions const &  opts 
)

(8) like (7) but no filename will be reported

Definition at line 204 of file parse.cpp.

204 { TmpParser tmp(opts); Tree tree; parse_json_(&tmp.parser, {} , json, &tree, tree.root_id()); return tree; }