rapidyaml 0.14.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
8namespace c4 {
9namespace yml {
10
11class Tree;
12class NodeRef;
13template<class EventHandler> class ParseEngine;
14struct EventHandlerTree;
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 * */
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
55RYML_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. */
61RYML_EXPORT void parse_in_place(Parser *parser, substr yaml, Tree *t, id_type node_id); /**< (2) like (1) but no filename will be reported */
62RYML_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. */
68RYML_EXPORT void parse_in_place(Parser *parser, substr yaml, Tree *t ); /**< (4) like (3) but no filename will be reported */
69RYML_EXPORT void parse_in_place(Parser *parser, csubstr filename, substr yaml, NodeRef node ); /**< (5) like (1) but the node is given as a NodeRef */
70RYML_EXPORT void parse_in_place(Parser *parser, substr yaml, NodeRef node ); /**< (6) like (5) but no filename will be reported */
71RYML_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 */
77RYML_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.
81RYML_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.
82RYML_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
83RYML_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.
84RYML_EXPORT void parse_json_in_place(Parser *parser, substr json, Tree *t ); ///< (4) like (3) but no filename will be reported
85RYML_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
86RYML_EXPORT void parse_json_in_place(Parser *parser, substr json, NodeRef node ); ///< (6) like (5) but no filename will be reported
87RYML_EXPORT Tree parse_json_in_place(Parser *parser, csubstr filename, substr json ); ///< (7) create a new tree, and parse JSON into its root node.
88RYML_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.
113RYML_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.
114RYML_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
115RYML_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.
116RYML_EXPORT void parse_in_place( substr yaml, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
117RYML_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
118RYML_EXPORT void parse_in_place( substr yaml, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
119RYML_EXPORT Tree parse_in_place(csubstr filename, substr yaml , ParserOptions const& opts={}); ///< (7) create a new tree, and parse YAML into its root node.
120RYML_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.
123RYML_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.
124RYML_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
125RYML_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.
126RYML_EXPORT void parse_json_in_place( substr json, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
127RYML_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
128RYML_EXPORT void parse_json_in_place( substr json, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
129RYML_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.
130RYML_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.
188RYML_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.
189RYML_EXPORT void parse_in_arena(Parser *parser, csubstr yaml, Tree *t, id_type node_id); ///< (2) like (1) but no filename will be reported
190RYML_EXPORT void parse_in_arena(Parser *parser, csubstr filename, csubstr yaml, Tree *t ); ///< (3) parse YAML into an existing tree, into its root node.
191RYML_EXPORT void parse_in_arena(Parser *parser, csubstr yaml, Tree *t ); ///< (4) like (3) but no filename will be reported
192RYML_EXPORT void parse_in_arena(Parser *parser, csubstr filename, csubstr yaml, NodeRef node ); ///< (5) like (1) but the node is given as a NodeRef
193RYML_EXPORT void parse_in_arena(Parser *parser, csubstr yaml, NodeRef node ); ///< (6) like (5) but no filename will be reported
194RYML_EXPORT Tree parse_in_arena(Parser *parser, csubstr filename, csubstr yaml ); ///< (7) create a new tree, and parse YAML into its root node.
195RYML_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.
198RYML_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.
199RYML_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
200RYML_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.
201RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr json, Tree *t ); ///< (4) like (3) but no filename will be reported
202RYML_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
203RYML_EXPORT void parse_json_in_arena(Parser *parser, csubstr json, NodeRef node ); ///< (6) like (5) but no filename will be reported
204RYML_EXPORT Tree parse_json_in_arena(Parser *parser, csubstr filename, csubstr json ); ///< (7) create a new tree, and parse JSON into its root node.
205RYML_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 */
214RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, substr yaml, Tree *t, id_type node_id);
215RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, csubstr filename, substr yaml, Tree *t, id_type node_id);
216RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, substr yaml, Tree *t );
217RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, csubstr filename, substr yaml, Tree *t );
218RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, substr yaml, NodeRef node );
219RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(Parser *parser, csubstr filename, substr yaml, NodeRef node );
220RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_in_arena(Parser *parser, substr yaml );
221RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_in_arena(Parser *parser, csubstr filename, substr yaml );
222RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, substr json, Tree *t, id_type node_id);
223RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, csubstr filename, substr json, Tree *t, id_type node_id);
224RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, substr json, Tree *t );
225RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, csubstr filename, substr json, Tree *t );
226RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, substr json, NodeRef node );
227RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(Parser *parser, csubstr filename, substr json, NodeRef node );
228RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_json_in_arena(Parser *parser, substr json );
229RYML_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.
274RYML_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.
275RYML_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
276RYML_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.
277RYML_EXPORT void parse_in_arena( csubstr yaml, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
278RYML_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
279RYML_EXPORT void parse_in_arena( csubstr yaml, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
280RYML_EXPORT Tree parse_in_arena(csubstr filename, csubstr yaml , ParserOptions const& opts={}); ///< (7) create a new tree, and parse YAML into its root node.
281RYML_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.
284RYML_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.
285RYML_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
286RYML_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.
287RYML_EXPORT void parse_json_in_arena( csubstr json, Tree *t , ParserOptions const& opts={}); ///< (4) like (3) but no filename will be reported
288RYML_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
289RYML_EXPORT void parse_json_in_arena( csubstr json, NodeRef node , ParserOptions const& opts={}); ///< (6) like (5) but no filename will be reported
290RYML_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.
291RYML_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 */
300RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena( substr yaml, Tree *t, id_type node_id);
301RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(csubstr filename, substr yaml, Tree *t, id_type node_id);
302RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena( substr yaml, Tree *t );
303RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(csubstr filename, substr yaml, Tree *t );
304RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena( substr yaml, NodeRef node );
305RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_in_arena(csubstr filename, substr yaml, NodeRef node );
307RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) Tree parse_in_arena(csubstr filename, substr yaml );
308RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena( substr json, Tree *t, id_type node_id);
309RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(csubstr filename, substr json, Tree *t, id_type node_id);
310RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena( substr json, Tree *t );
311RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(csubstr filename, substr json, Tree *t );
312RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena( substr json, NodeRef node );
313RYML_DEPRECATED(RYML_DONT_PARSE_SUBSTR_IN_ARENA) void parse_json_in_arena(csubstr filename, substr json, NodeRef node );
316/** @endcond */
317
318/** @} */
319/** @} */
320
321} // namespace yml
322} // namespace c4
323
324#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:967
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: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
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:249
(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.
Definition common.hpp:355