rapidyaml  0.16.0
parseandemitYAML,anddoitfast
Parse in place with existing parser

parse a mutable YAML source buffer (re)using an existing parser. More...

Functions

void c4::yml::parse_in_place (Parser *parser, csubstr filename, substr yaml, Tree *t, id_type node_id)
 (1) parse YAML into an existing tree node. More...
 
void c4::yml::parse_in_place (Parser *parser, substr yaml, Tree *t, id_type node_id)
 (2) like (1) but no filename will be reported More...
 
void c4::yml::parse_in_place (Parser *parser, csubstr filename, substr yaml, Tree *t)
 (3) parse YAML into the root node of an existing tree. More...
 
void c4::yml::parse_in_place (Parser *parser, substr yaml, Tree *t)
 (4) like (3) but no filename will be reported More...
 
void c4::yml::parse_in_place (Parser *parser, csubstr filename, substr yaml, NodeRef node)
 (5) like (1) but the node is given as a NodeRef More...
 
void c4::yml::parse_in_place (Parser *parser, substr yaml, NodeRef node)
 (6) like (5) but no filename will be reported More...
 
Tree c4::yml::parse_in_place (Parser *parser, csubstr filename, substr yaml)
 (7) create a new tree, and parse YAML into its root node. More...
 
Tree c4::yml::parse_in_place (Parser *parser, substr yaml)
 (8) like (7) but no filename will be reported More...
 
void c4::yml::parse_json_in_place (Parser *parser, csubstr filename, substr json, Tree *t, id_type node_id)
 (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 (Parser *parser, substr json, Tree *t, id_type node_id)
 (2) like (1) but no filename will be reported More...
 
void c4::yml::parse_json_in_place (Parser *parser, csubstr filename, substr json, Tree *t)
 (3) parse JSON into an existing tree, into its root node. More...
 
void c4::yml::parse_json_in_place (Parser *parser, substr json, Tree *t)
 (4) like (3) but no filename will be reported More...
 
void c4::yml::parse_json_in_place (Parser *parser, csubstr filename, substr json, NodeRef node)
 (5) like (1) but the node is given as a NodeRef More...
 
void c4::yml::parse_json_in_place (Parser *parser, substr json, NodeRef node)
 (6) like (5) but no filename will be reported More...
 
Tree c4::yml::parse_json_in_place (Parser *parser, csubstr filename, substr json)
 (7) create a new tree, and parse JSON into its root node. More...
 
Tree c4::yml::parse_json_in_place (Parser *parser, substr json)
 (8) like (7) but no filename will be reported More...
 

Detailed Description

parse a mutable YAML source buffer (re)using an existing parser.

Scalars requiring filtering are mutated in place (except in the rare cases where the filtered scalar is longer than the original scalar, or where filtering was disabled before the call). These overloads accept an existing parser object, and provide the opportunity to use special parser options.

See also
ParserOptions

Function Documentation

void c4::yml::parse_in_place ( Parser *  parser,
csubstr  filename,
substr  yaml,
Tree *  t,
id_type  node_id 
)

(1) parse YAML into an existing tree node.

The filename will be used in any error messages arising during the parse. The callbacks in the tree are kept, and used to allocate the tree members, if any allocation is required.

Definition at line 165 of file parse.cpp.

Referenced by IntsParser::parse_or_resize_and_then_parse(), sample_lightning_overview(), sample_parse_file(), sample_parse_in_place(), sample_quick_overview(), sample_std_types(), and sample_tree_arena().

165 { check_(parser, tree); parse_yaml_(parser, filename, yaml, tree, node_id); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_in_place ( Parser *  parser,
substr  yaml,
Tree *  tree,
id_type  node_id 
)

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

Definition at line 166 of file parse.cpp.

166 { check_(parser, tree); parse_yaml_(parser, {} , yaml, tree, node_id); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_in_place ( Parser *  parser,
csubstr  filename,
substr  yaml,
Tree *  t 
)

(3) parse YAML into the root node of an existing tree.

The filename will be used in any error messages arising during the parse. The callbacks in the tree are kept, and used to allocate the tree members, if any allocation is required.

Definition at line 167 of file parse.cpp.

167 { check_(parser, tree); parse_yaml_(parser, filename, yaml, tree, tree->root_id()); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_in_place ( Parser *  parser,
substr  yaml,
Tree *  tree 
)

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

Definition at line 168 of file parse.cpp.

168 { check_(parser, tree); parse_yaml_(parser, {} , yaml, tree, tree->root_id()); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_in_place ( Parser *  parser,
csubstr  filename,
substr  yaml,
NodeRef  node 
)

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

Definition at line 169 of file parse.cpp.

169 { check_(parser, node); parse_yaml_(parser, filename, yaml, node.tree(), node.id()); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_in_place ( Parser *  parser,
substr  yaml,
NodeRef  node 
)

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

Definition at line 170 of file parse.cpp.

170 { check_(parser, node); parse_yaml_(parser, {} , yaml, node.tree(), node.id()); }
Parser parser
Definition: parse.cpp:117
Tree c4::yml::parse_in_place ( Parser *  parser,
csubstr  filename,
substr  yaml 
)

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

The filename will be used in any error messages arising during the parse. The tree is created with the callbacks currently in the parser.

Definition at line 171 of file parse.cpp.

171 { check_(parser); Tree tree(parser->callbacks()); parse_yaml_(parser, filename, yaml, &tree, tree.root_id()); return tree; }
Parser parser
Definition: parse.cpp:117
Tree c4::yml::parse_in_place ( Parser *  parser,
substr  yaml 
)

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

Definition at line 172 of file parse.cpp.

172 { check_(parser); Tree tree(parser->callbacks()); parse_yaml_(parser, {} , yaml, &tree, tree.root_id()); return tree; }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_json_in_place ( Parser *  parser,
csubstr  filename,
substr  json,
Tree *  tree,
id_type  node_id 
)

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

Definition at line 187 of file parse.cpp.

187 { check_(parser, tree); parse_json_(parser, filename, json, tree, node_id); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_json_in_place ( Parser *  parser,
substr  json,
Tree *  tree,
id_type  node_id 
)

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

Definition at line 188 of file parse.cpp.

188 { check_(parser, tree); parse_json_(parser, {} , json, tree, node_id); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_json_in_place ( Parser *  parser,
csubstr  filename,
substr  json,
Tree *  tree 
)

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

Definition at line 189 of file parse.cpp.

189 { check_(parser, tree); parse_json_(parser, filename, json, tree, tree->root_id()); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_json_in_place ( Parser *  parser,
substr  json,
Tree *  tree 
)

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

Definition at line 190 of file parse.cpp.

190 { check_(parser, tree); parse_json_(parser, {} , json, tree, tree->root_id()); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_json_in_place ( Parser *  parser,
csubstr  filename,
substr  json,
NodeRef  node 
)

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

Definition at line 191 of file parse.cpp.

191 { check_(parser, node); parse_json_(parser, filename, json, node.tree(), node.id()); }
Parser parser
Definition: parse.cpp:117
void c4::yml::parse_json_in_place ( Parser *  parser,
substr  json,
NodeRef  node 
)

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

Definition at line 192 of file parse.cpp.

192 { check_(parser, node); parse_json_(parser, {} , json, node.tree(), node.id()); }
Parser parser
Definition: parse.cpp:117
Tree c4::yml::parse_json_in_place ( Parser *  parser,
csubstr  filename,
substr  json 
)

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

Definition at line 193 of file parse.cpp.

193 { check_(parser); Tree tree(parser->callbacks()); parse_json_(parser, filename, json, &tree, tree.root_id()); return tree; }
Parser parser
Definition: parse.cpp:117
Tree c4::yml::parse_json_in_place ( Parser *  parser,
substr  json 
)

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

Definition at line 194 of file parse.cpp.

194 { check_(parser); Tree tree(parser->callbacks()); parse_json_(parser, {} , json, &tree, tree.root_id()); return tree; }
Parser parser
Definition: parse.cpp:117