rapidyaml  0.13.0
parse and emit YAML, and do it fast
parse.hpp
Go to the documentation of this file.
1 #ifndef _C4_YML_PARSE_HPP_
2 #define _C4_YML_PARSE_HPP_
3 
4 #ifndef _C4_YML_COMMON_HPP_
5 #include "c4/yml/common.hpp"
6 #endif
7 
8 namespace c4 {
9 namespace yml {
10 
11 class Tree;
12 class NodeRef;
13 template<class EventHandler> class ParseEngine;
14 struct EventHandlerTree;
15 RYML_EXPORT id_type estimate_tree_capacity(csubstr src); // NOLINT
16 
17 
18 /** @addtogroup doc_parse
19  * @{ */
20 
21 /** This is the main ryml parser, where the parser events are handled
22  * to create a ryml tree.
23  *
24  * @warning This class cannot parse YAML where there are container
25  * keys. This is not a limitation of the @ref ParseEngine, but of the
26  * @ref EventHandlerTree, which is present because the @ref Tree does
27  * not accept containers as keys. However, the @ref ParseEngine *can*
28  * parse container keys; consult its documentation for more details.
29  *
30  * @see ParserOptions
31  * @see ParseEngine
32  * @see EventHandlerTree
33  * */
34 using Parser = ParseEngine<EventHandlerTree>;
35 
36 
37 //-----------------------------------------------------------------------------
38 
39 /** @defgroup doc_parse_in_place__with_existing_parser Parse in place with existing parser
40  *
41  * @brief parse a mutable YAML source buffer (re)using an existing
42  * parser. Scalars requiring filtering are mutated in place (except in
43  * the rare cases where the filtered scalar is longer than the
44  * original scalar, or where filtering was disabled before the
45  * call). These overloads accept an existing parser object, and
46  * provide the opportunity to use special parser options.
47  *
48  * @see ParserOptions
49  *
50  * @{
51  */
52 
53 // this is vertically aligned to highlight the parameter differences.
54 
55 RYML_EXPORT void parse_in_place(Parser *parser, csubstr filename, substr yaml, Tree *t, id_type node_id); /**< (1) parse YAML into an existing tree node.
56  *
57  * The filename will be used in any error messages
58  * arising during the parse. The callbacks in the
59  * tree are kept, and used to allocate
60  * the tree members, if any allocation is required. */
61 RYML_EXPORT void parse_in_place(Parser *parser, substr yaml, Tree *t, id_type node_id); /**< (2) like (1) but no filename will be reported */
62 RYML_EXPORT void parse_in_place(Parser *parser, csubstr filename, substr yaml, Tree *t ); /**< (3) parse YAML into the root node of an existing tree.
63  *
64  * The filename will be used in any error messages
65  * arising during the parse. The callbacks in the
66  * tree are kept, and used to allocate
67  * the tree members, if any allocation is required. */
68 RYML_EXPORT void parse_in_place(Parser *parser, substr yaml, Tree *t ); /**< (4) like (3) but no filename will be reported */
69 RYML_EXPORT void parse_in_place(Parser *parser, csubstr filename, substr yaml, NodeRef node ); /**< (5) like (1) but the node is given as a NodeRef */
70 RYML_EXPORT void parse_in_place(Parser *parser, substr yaml, NodeRef node ); /**< (6) like (5) but no filename will be reported */
71 RYML_EXPORT Tree parse_in_place(Parser *parser, csubstr filename, substr yaml ); /**< (7) create a new tree, and parse YAML into its root node.
72  *
73  * The filename will be used in any error messages
74  * arising during the parse. The tree is created with
75  * the callbacks currently in the parser.
76  */
77 RYML_EXPORT Tree parse_in_place(Parser *parser, substr yaml ); /**< (8) like (7) but no filename will be reported */
78 
79 
80 // this is vertically aligned to highlight the parameter differences.
81 RYML_EXPORT void 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.
82 RYML_EXPORT void parse_json_in_place(Parser *parser, substr json, Tree *t, id_type node_id); ///< (2) like (1) but no filename will be reported
83 RYML_EXPORT void parse_json_in_place(Parser *parser, csubstr filename, substr json, Tree *t ); ///< (3) parse JSON into an existing tree, into its root node.
84 RYML_EXPORT void parse_json_in_place(Parser *parser, substr json, Tree *t ); ///< (4) like (3) but no filename will be reported
85 RYML_EXPORT void parse_json_in_place(Parser *parser, csubstr filename, substr json, NodeRef node ); ///< (5) like (1) but the node is given as a NodeRef
86 RYML_EXPORT void parse_json_in_place(Parser *parser, substr json, NodeRef node ); ///< (6) like (5) but no filename will be reported
87 RYML_EXPORT Tree parse_json_in_place(Parser *parser, csubstr filename, substr json ); ///< (7) create a new tree, and parse JSON into its root node.
88 RYML_EXPORT Tree parse_json_in_place(Parser *parser, substr json ); ///< (8) like (7) but no filename will be reported
89 
90 /** @} */
91 
92 
93 //-----------------------------------------------------------------------------
94 
95 /** @defgroup doc_parse_in_place___with_temporary_parser Parse in place with temporary parser
96  *
97  * @brief parse a mutable YAML source buffer. Scalars requiring
98  * filtering are mutated in place (except in the rare cases where the
99  * filtered scalar is longer than the original scalar).
100  *
101  * @note These freestanding functions use a temporary parser object,
102  * and are convenience functions to enable the user to easily parse
103  * YAML without the need to explicitly instantiate a parser and event
104  * handler. Note that some properties (notably node locations in the
105  * original source code) are only available through the parser
106  * class. If you need access to any of these properties, use
107  * the appropriate overload from @ref doc_parse_in_place__with_existing_parser
108  *
109  * @{
110  */
111 
112 // this is vertically aligned to highlight the parameter differences.
113 RYML_EXPORT void 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.
114 RYML_EXPORT void parse_in_place( substr yaml, Tree *t, id_type node_id, ParserOptions const& opts={}); ///< (2) like (1) but no filename will be reported
115 RYML_EXPORT void parse_in_place(csubstr filename, substr yaml, Tree *t , ParserOptions const& opts={}); ///< (3) parse YAML into an existing tree, into its root node.
116 RYML_EXPORT void parse_in_place( substr yaml, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
117 RYML_EXPORT void parse_in_place(csubstr filename, substr yaml, NodeRef node , ParserOptions const& opts={}); ///< (5) like (1) but the node is given as a NodeRef
118 RYML_EXPORT void parse_in_place( substr yaml, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
119 RYML_EXPORT Tree parse_in_place(csubstr filename, substr yaml , ParserOptions const& opts={}); ///< (7) create a new tree, and parse YAML into its root node.
120 RYML_EXPORT Tree parse_in_place( substr yaml , ParserOptions const& opts={}); ///< (8) like (7) but no filename will be reported
121 
122 // this is vertically aligned to highlight the parameter differences.
123 RYML_EXPORT void 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.
124 RYML_EXPORT void parse_json_in_place( substr json, Tree *t, id_type node_id, ParserOptions const& opts={}); ///< (2) like (1) but no filename will be reported
125 RYML_EXPORT void parse_json_in_place(csubstr filename, substr json, Tree *t , ParserOptions const& opts={}); ///< (3) parse JSON into an existing tree, into its root node.
126 RYML_EXPORT void parse_json_in_place( substr json, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
127 RYML_EXPORT void parse_json_in_place(csubstr filename, substr json, NodeRef node , ParserOptions const& opts={}); ///< (5) like (1) but the node is given as a NodeRef
128 RYML_EXPORT void parse_json_in_place( substr json, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
129 RYML_EXPORT Tree parse_json_in_place(csubstr filename, substr json , ParserOptions const& opts={}); ///< (7) create a new tree, and parse JSON into its root node.
130 RYML_EXPORT Tree parse_json_in_place( substr json , ParserOptions const& opts={}); ///< (8) like (7) but no filename will be reported
131 
132 /** @} */
133 
134 
135 //-----------------------------------------------------------------------------
136 
137 
138 /** @defgroup doc_parse_in_arena__with_existing_parser Parse in arena with existing parser
139  *
140  * @brief parse a read-only (immutable) YAML source buffer. This is
141  * achieved by first copying the contents of the buffer to the tree's
142  * arena, and then calling @ref parse_in_arena() . All the resulting
143  * scalars will be filtered in the arena. These overloads accept an
144  * existing parser object, and provide the opportunity to use special
145  * parser options.
146  *
147  * @see ParserOptions
148  *
149  *
150  * @note These freestanding functions use a temporary parser object,
151  * and are convenience functions to easily parse YAML without the need
152  * to instantiate a separate parser. Note that some properties
153  * (notably node locations in the original source code) are only
154  * available through the parser class. If you need access to any of
155  * these properties, use the appropriate overload from @ref
156  * doc_parse_in_arena__with_existing_parser
157  *
158  * @warning overloads receiving a substr YAML buffer are intentionally
159  * left undefined, such that calling parse_in_arena() with a substr
160  * will cause a linker error. This is to prevent an accidental copy of
161  * the source buffer to the tree's arena, because substr (which is
162  * mutable) is implicitly convertible to csubstr (which is
163  * immutable). If you really intend to parse a mutable buffer in the
164  * tree's arena, convert it first to immutable by assigning the substr
165  * to a csubstr prior to calling parse_in_arena(). This is not needed
166  * for parse_in_place() because csubstr is not implicitly convertible
167  * to substr. To be clear:
168  * ```c++
169  * substr mutable_buffer = ...;
170  * parser.parse_in_arena(mutable_buffer); // linker error
171  *
172  * csubstr immutable_buffer = mutable_buffer; // convert first to csubstr
173  * parser.parse_in_arena(immutable_buffer); // ok
174  * ```
175  *
176  * @{
177  */
178 
179 #define RYML_DONT_PARSE_SUBSTR_IN_ARENA "" \
180  "Do not pass a (mutable) substr to parse_in_arena(); " \
181  "if you have a substr, it should be parsed in place. " \
182  "Consider using parse_in_place() instead, or convert " \
183  "the buffer to csubstr prior to calling. This function " \
184  " is deliberately left undefined, so that calling it " \
185  "will cause a linker error."
186 
187 // this is vertically aligned to highlight the parameter differences.
188 RYML_EXPORT void parse_in_arena(Parser *parser, csubstr filename, csubstr 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.
189 RYML_EXPORT void parse_in_arena(Parser *parser, csubstr yaml, Tree *t, id_type node_id); ///< (2) like (1) but no filename will be reported
190 RYML_EXPORT void parse_in_arena(Parser *parser, csubstr filename, csubstr yaml, Tree *t ); ///< (3) parse YAML into an existing tree, into its root node.
191 RYML_EXPORT void parse_in_arena(Parser *parser, csubstr yaml, Tree *t ); ///< (4) like (3) but no filename will be reported
192 RYML_EXPORT void parse_in_arena(Parser *parser, csubstr filename, csubstr yaml, NodeRef node ); ///< (5) like (1) but the node is given as a NodeRef
193 RYML_EXPORT void parse_in_arena(Parser *parser, csubstr yaml, NodeRef node ); ///< (6) like (5) but no filename will be reported
194 RYML_EXPORT Tree parse_in_arena(Parser *parser, csubstr filename, csubstr yaml ); ///< (7) create a new tree, and parse YAML into its root node.
195 RYML_EXPORT Tree parse_in_arena(Parser *parser, csubstr yaml ); ///< (8) like (7) but no filename will be reported
196 
197 // this is vertically aligned to highlight the parameter differences.
198 RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr filename, csubstr 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.
199 RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr json, Tree *t, id_type node_id); ///< (2) like (1) but no filename will be reported
200 RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr filename, csubstr json, Tree *t ); ///< (3) parse JSON into an existing tree, into its root node.
201 RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr json, Tree *t ); ///< (4) like (3) but no filename will be reported
202 RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr filename, csubstr json, NodeRef node ); ///< (5) like (1) but the node is given as a NodeRef
203 RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr json, NodeRef node ); ///< (6) like (5) but no filename will be reported
204 RYML_EXPORT Tree parse_json_in_arena(Parser *parser, csubstr filename, csubstr json ); ///< (7) create a new tree, and parse JSON into its root node.
205 RYML_EXPORT Tree parse_json_in_arena(Parser *parser, csubstr json ); ///< (8) like (7) but no filename will be reported
206 
207 /* READ THE DEPRECATION NOTE!
208  *
209  * All of the functions below are intentionally left undefined, to
210  * prevent them being used.
211  *
212  */
213 /** @cond dev */
214 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, substr yaml, Tree *t, id_type node_id);
215 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, csubstr filename, substr yaml, Tree *t, id_type node_id);
216 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, substr yaml, Tree *t );
217 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, csubstr filename, substr yaml, Tree *t );
218 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, substr yaml, NodeRef node );
219 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, csubstr filename, substr yaml, NodeRef node );
220 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_in_arena(Parser *parser, substr yaml );
221 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_in_arena(Parser *parser, csubstr filename, substr yaml );
222 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, substr json, Tree *t, id_type node_id);
223 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, csubstr filename, substr json, Tree *t, id_type node_id);
224 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, substr json, Tree *t );
225 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, csubstr filename, substr json, Tree *t );
226 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, substr json, NodeRef node );
227 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, csubstr filename, substr json, NodeRef node );
228 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_json_in_arena(Parser *parser, substr json );
229 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_json_in_arena(Parser *parser, csubstr filename, substr json );
230 /** @endcond */
231 
232 /** @} */
233 
234 
235 //-----------------------------------------------------------------------------
236 
237 
238 /** @defgroup doc_parse_in_arena__with_temporary_parser Parse in arena with temporary parser
239  *
240  * @brief parse a read-only (immutable) YAML source buffer. This is
241  * achieved by first copying the contents of the buffer to the tree's
242  * arena, and then calling @ref parse_in_arena() .
243  *
244  * @note These freestanding functions use a temporary parser object,
245  * and are convenience functions to easily one-off parse YAML without
246  * the need to instantiate a separate parser. Note that some
247  * properties (notably node locations in the original source code) are
248  * only available through the parser class. If you need access to any
249  * of these properties, use the appropriate overload from @ref
250  * doc_parse_in_arena__with_existing_parser
251  *
252  * @warning overloads receiving a substr YAML buffer are intentionally
253  * left undefined, such that calling parse_in_arena() with a substr
254  * will cause a linker error. This is to prevent an accidental copy of
255  * the source buffer to the tree's arena, because substr (which is
256  * mutable) is implicitly convertible to csubstr (which is
257  * immutable). If you really intend to parse a mutable buffer in the
258  * tree's arena, convert it first to immutable by assigning the substr
259  * to a csubstr prior to calling parse_in_arena(). This is not needed
260  * for parse_in_place() because csubstr is not implicitly convertible
261  * to substr. To be clear:
262  * ```c++
263  * substr mutable_buffer = ...;
264  * parser.parse_in_arena(mutable_buffer); // linker error
265  *
266  * csubstr immutable_buffer = mutable_buffer; // convert first to csubstr
267  * parser.parse_in_arena(immutable_buffer); // ok now
268  * ```
269  *
270  * @{
271  */
272 
273 // this is vertically aligned to highlight the parameter differences.
274 RYML_EXPORT void parse_in_arena(csubstr filename, csubstr 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.
275 RYML_EXPORT void parse_in_arena( csubstr yaml, Tree *t, id_type node_id, ParserOptions const& opts={}); ///< (2) like (1) but no filename will be reported
276 RYML_EXPORT void parse_in_arena(csubstr filename, csubstr yaml, Tree *t , ParserOptions const& opts={}); ///< (3) parse YAML into an existing tree, into its root node.
277 RYML_EXPORT void parse_in_arena( csubstr yaml, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
278 RYML_EXPORT void parse_in_arena(csubstr filename, csubstr yaml, NodeRef node , ParserOptions const& opts={}); ///< (5) like (1) but the node is given as a NodeRef
279 RYML_EXPORT void parse_in_arena( csubstr yaml, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
280 RYML_EXPORT Tree parse_in_arena(csubstr filename, csubstr yaml , ParserOptions const& opts={}); ///< (7) create a new tree, and parse YAML into its root node.
281 RYML_EXPORT Tree parse_in_arena( csubstr yaml , ParserOptions const& opts={}); ///< (8) like (7) but no filename will be reported
282 
283 // this is vertically aligned to highlight the parameter differences.
284 RYML_EXPORT void parse_json_in_arena(csubstr filename, csubstr 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.
285 RYML_EXPORT void parse_json_in_arena( csubstr json, Tree *t, id_type node_id, ParserOptions const& opts={}); ///< (2) like (1) but no filename will be reported
286 RYML_EXPORT void parse_json_in_arena(csubstr filename, csubstr json, Tree *t , ParserOptions const& opts={}); ///< (3) parse JSON into an existing tree, into its root node.
287 RYML_EXPORT void parse_json_in_arena( csubstr json, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
288 RYML_EXPORT void parse_json_in_arena(csubstr filename, csubstr json, NodeRef node , ParserOptions const& opts={}); ///< (5) like (1) but the node is given as a NodeRef
289 RYML_EXPORT void parse_json_in_arena( csubstr json, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
290 RYML_EXPORT Tree parse_json_in_arena(csubstr filename, csubstr json , ParserOptions const& opts={}); ///< (7) create a new tree, and parse JSON into its root node.
291 RYML_EXPORT Tree parse_json_in_arena( csubstr json , ParserOptions const& opts={}); ///< (8) like (7) but no filename will be reported
292 
293 
294 /* READ THE DEPRECATION NOTE!
295  *
296  * All of the functions below are intentionally left undefined, to
297  * prevent them being used.
298  */
299 /** @cond dev */
300 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena( substr yaml, Tree *t, id_type node_id);
301 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(csubstr filename, substr yaml, Tree *t, id_type node_id);
302 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena( substr yaml, Tree *t );
303 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(csubstr filename, substr yaml, Tree *t );
304 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena( substr yaml, NodeRef node );
305 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(csubstr filename, substr yaml, NodeRef node );
306 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_in_arena( substr yaml );
307 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_in_arena(csubstr filename, substr yaml );
308 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena( substr json, Tree *t, id_type node_id);
309 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(csubstr filename, substr json, Tree *t, id_type node_id);
310 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena( substr json, Tree *t );
311 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(csubstr filename, substr json, Tree *t );
312 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena( substr json, NodeRef node );
313 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(csubstr filename, substr json, NodeRef node );
314 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_json_in_arena( substr json );
315 RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_json_in_arena(csubstr filename, substr json );
316 /** @endcond */
317 
318 /** @} */
319 /** @} */
320 
321 } // namespace yml
322 } // namespace c4
323 
324 #endif /* _C4_YML_PARSE_HPP_ */
Common utilities and infrastructure used by ryml.
#define RYML_EXPORT
Definition: export.hpp:18
void parse_in_arena(Parser *parser, csubstr filename, csubstr 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 du...
Definition: parse.cpp:92
#define RYML_DONT_PARSE_SUBSTR_IN_ARENA
Definition: parse.hpp:179
void parse_json_in_arena(Parser *parser, csubstr filename, csubstr 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 du...
Definition: parse.cpp:113
void 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 du...
Definition: parse.cpp:44
void parse_in_place(Parser *parser, csubstr filename, substr yaml, Tree *t, id_type node_id)
(1) parse YAML into an existing tree node.
Definition: parse.cpp:38
ParseEngine< EventHandlerTree > Parser
This is the main ryml parser, where the parser events are handled to create a ryml tree.
Definition: fwd.hpp:19
id_type estimate_tree_capacity(csubstr src)
Quickly inspect the source to estimate the number of nodes the resulting tree is likely to have.
Definition: parse.cpp:135
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:244
(Undefined by default) Use shorter error message from checks/asserts: do not show the check condition...
Definition: common.cpp:14