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