6920{
6922
6923
6925
6926
6928
6929
6933
6934
6936
6937
6940
6941
6944
6945
6946 {
6950
6953 parser.reserve_stack(10);
6954
6955
6956
6958
6959 parser.reserve_stack(20);
6961
6962
6964 parse_in_arena(&parser,
"", R
"([a, b, c, d, {foo: bar, money: pennys}])", &tree);
6967 }
6969
6970
6972}
void reserve_arena(size_t arena_cap=RYML_DEFAULT_TREE_ARENA_CAPACITY)
ensure the tree's internal string arena is at least the given capacity
void reserve(id_type node_capacity=RYML_DEFAULT_TREE_CAPACITY)
void set_callbacks(Callbacks const &c)
set the global callbacks for the library; after a call to this function, these callbacks will be used...
Callbacks const & get_callbacks()
get the global callbacks
void parse_in_arena(Parser *parser, csubstr filename, csubstr yaml, Tree *tree, id_type node_id)
(1) parse YAML into an existing tree node. The filename will be used in any error messages arising du...
ParseEngine< EventHandlerTree > Parser
This is the main ryml parser, where the parser events are handled to create a ryml tree (see Event Ha...
#define CHECK(predicate)
a testing assertion, used only in this quickstart
static void s_free(void *mem, size_t len, void *this_)
ryml::Callbacks callbacks()
static void * s_allocate(size_t len, void *, void *this_)
A c-style callbacks class to customize behavior on errors or allocation.
pfn_allocate m_allocate
a pointer to an allocate handler function
pfn_free m_free
a pointer to a free handler function
The event handler to create a ryml Tree.