6836{
6838
6839
6841
6842
6844
6845
6849
6850
6852
6853
6856
6857
6860
6861
6862 {
6866
6869 parser.reserve_stack(10);
6870
6871
6872
6874
6875 parser.reserve_stack(20);
6877
6878
6880 parse_in_arena(&parser,
"", R
"([a, b, c, d, {foo: bar, money: pennys}])", &tree);
6883 }
6885
6886
6888}
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.