rapidyaml 0.15.2
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
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.
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
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.
void c4::yml::parse_in_place (Parser *parser, substr yaml, Tree *t)
 (4) like (3) but no filename will be reported
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
void c4::yml::parse_in_place (Parser *parser, substr yaml, NodeRef node)
 (6) like (5) but no filename will be reported
Tree c4::yml::parse_in_place (Parser *parser, csubstr filename, substr yaml)
 (7) create a new tree, and parse YAML into its root node.
Tree c4::yml::parse_in_place (Parser *parser, substr yaml)
 (8) like (7) but no filename will be reported
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.
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
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.
void c4::yml::parse_json_in_place (Parser *parser, substr json, Tree *t)
 (4) like (3) but no filename will be reported
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
void c4::yml::parse_json_in_place (Parser *parser, substr json, NodeRef node)
 (6) like (5) but no filename will be reported
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.
Tree c4::yml::parse_json_in_place (Parser *parser, substr json)
 (8) like (7) but no filename will be reported

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

◆ parse_in_place() [1/8]

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.

165{ check_(parser, tree); parse_yaml_(parser, filename, yaml, tree, node_id); }

◆ parse_in_place() [2/8]

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); }

◆ parse_in_place() [3/8]

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()); }

◆ parse_in_place() [4/8]

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()); }
id_type root_id() const
Get the id of the root node. The tree must not be empty. The tree can be empty only when constructed ...
Definition tree.hpp:333

◆ parse_in_place() [5/8]

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()); }
Tree * tree() noexcept
Definition node.hpp:914
id_type id() const noexcept
Definition node.hpp:917

◆ parse_in_place() [6/8]

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()); }

◆ parse_in_place() [7/8]

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; }
Callbacks const & callbacks() const
Get the current callbacks in the parser.

◆ parse_in_place() [8/8]

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; }

◆ parse_json_in_place() [1/8]

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); }

◆ parse_json_in_place() [2/8]

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); }

◆ parse_json_in_place() [3/8]

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()); }

◆ parse_json_in_place() [4/8]

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()); }

◆ parse_json_in_place() [5/8]

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()); }

◆ parse_json_in_place() [6/8]

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()); }

◆ parse_json_in_place() [7/8]

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; }

◆ parse_json_in_place() [8/8]

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; }