|
rapidyaml
0.10.0
parse and emit YAML, and do it fast
|
Example code for every feature. More...
Modules | |
| Sample helpers | |
| Functions and classes used in the examples of this sample. | |
Functions | |
| ryml::Callbacks | sample::ErrorHandlerExample::callbacks () |
| a helper to create the Callbacks object with the custom error handler More... | |
| static void | sample::ErrorHandlerExample::s_error (const char *msg, size_t len, ryml::Location loc, void *this_) |
| template<class Fn > | |
| bool | sample::ErrorHandlerExample::check_error_occurs (Fn &&fn) const |
| template<class Fn > | |
| bool | sample::ErrorHandlerExample::check_assertion_occurs (Fn &&fn) const |
| void | sample::ErrorHandlerExample::check_effect (bool committed) const |
| sample::ErrorHandlerExample::ErrorHandlerExample () | |
| sample::ScopedErrorHandlerExample::ScopedErrorHandlerExample () | |
| sample::ScopedErrorHandlerExample::~ScopedErrorHandlerExample () | |
| void | sample::sample_lightning_overview () |
| a lightning tour over most features see sample_quick_overview More... | |
| void | sample::sample_quick_overview () |
| a brief tour over most features More... | |
| void | sample::sample_substr () |
| demonstrate usage of ryml::substr and ryml::csubstr More... | |
| void | sample::sample_parse_file () |
| demonstrate how to load a YAML file from disk to parse with ryml. More... | |
| void | sample::sample_parse_in_place () |
| demonstrate in-place parsing of a mutable YAML source buffer. More... | |
| void | sample::sample_parse_in_arena () |
| demonstrate parsing of a read-only YAML source buffer More... | |
| void | sample::sample_parse_reuse_tree () |
| demonstrate reuse/modification of tree when parsing More... | |
| void | sample::sample_parse_reuse_parser () |
| Demonstrates reuse of an existing parser. More... | |
| void | sample::sample_parse_reuse_tree_and_parser () |
| for ultimate speed when parsing multiple times, reuse both the tree and parser More... | |
| void | sample::sample_iterate_trees () |
| shows how to programatically iterate through trees More... | |
| void | sample::sample_create_trees () |
| shows how to programatically create trees More... | |
| void | sample::sample_tree_arena () |
| demonstrates explicit and implicit interaction with the tree's string arena. More... | |
| void | sample::sample_fundamental_types () |
| ryml provides facilities for serializing and deserializing the C++ fundamental types, including boolean and null values; this is provided by the several overloads in to_chars: generalized chars to value and from_chars: generalized chars to value. More... | |
| void | sample::sample_empty_null_values () |
| Shows how to deal with empty/null values. More... | |
| void | sample::sample_formatting () |
| ryml provides facilities for formatting/deformatting (imported from c4core into the ryml namespace). More... | |
| void | sample::sample_base64 () |
| demonstrates how to read and write base64-encoded blobs. More... | |
| void | sample::sample_user_scalar_types () |
| to add scalar types (ie leaf types converting to/from string), define the functions above for those types. More... | |
| void | sample::sample_user_container_types () |
| shows how to serialize/deserialize container types. More... | |
| void | sample::sample_std_types () |
| demonstrates usage with the std implementations provided by ryml in the ryml_std.hpp header More... | |
| void | sample::sample_float_precision () |
| control precision of serialized floats More... | |
| void | sample::sample_emit_to_container () |
| demonstrates how to emit to a linear container of char More... | |
| void | sample::sample_emit_to_stream () |
| demonstrates how to emit to a stream-like structure More... | |
| void | sample::sample_emit_to_file () |
| demonstrates how to emit to a FILE* More... | |
| void | sample::sample_emit_nested_node () |
| just like parsing into a nested node, you can also emit from a nested node. More... | |
| void | sample::sample_style () |
| [experimental] how to query/set/modify node style. More... | |
| void | sample::sample_json () |
| shows how to parse and emit JSON. More... | |
| void | sample::sample_anchors_and_aliases () |
| demonstrates usage with anchors and alias references. More... | |
| void | sample::sample_anchors_and_aliases_create () |
| demonstrates how to use the API to programatically create anchors and aliases More... | |
| void | sample::sample_tags () |
| void | sample::sample_tag_directives () |
| void | sample::sample_docs () |
| void | sample::sample_error_handler () |
| demonstrates how to set a custom error handler for ryml More... | |
| void | sample::sample_global_allocator () |
| demonstrates how to set the global allocator for ryml More... | |
| void | sample::sample_per_tree_allocator () |
| void | sample::sample_static_trees () |
| shows how to work around the static initialization order fiasco when using a static-duration ryml tree More... | |
| void | sample::sample_location_tracking () |
| demonstrates how to obtain the (zero-based) location of a node from a recently parsed tree More... | |
Variables | |
| ryml::Callbacks | sample::ErrorHandlerExample::defaults |
Example code for every feature.
This file does a quick tour of ryml.
It has multiple self-contained and well-commented samples that illustrate how to use ryml, and how it works.
Although this is not a unit test, the samples are written as a sequence of actions and predicate checks to better convey what is the expected result at any stage. And to ensure the code here is correct and up to date, it's also run as part of the CI tests.
If something is unclear, please open an issue or send a pull request at https://github.com/biojppm/rapidyaml . If you have an issue while using ryml, it is also encouraged to try to reproduce the issue here, or look first through the relevant section.
Happy ryml'ing!
The directories that exist side-by-side with this file contain several examples on how to build this with cmake, such that you can hit the ground running. See the relevant section of the main README for an overview of the different choices. I suggest starting first with the add_subdirectory example, treating it just like any other self-contained cmake project.
Or very quickly, to build and run this sample on your PC, start by creating this CMakeLists.txt:
Now run the following commands in the same folder:
| ryml::Callbacks sample::ErrorHandlerExample::callbacks | ( | ) |
a helper to create the Callbacks object with the custom error handler
Definition at line 5448 of file quickstart.cpp.
Referenced by sample::ScopedErrorHandlerExample::ScopedErrorHandlerExample(), sample::sample_fundamental_types(), and sample::sample_quick_overview().
|
static |
| bool sample::ErrorHandlerExample::check_error_occurs | ( | Fn && | fn | ) | const |
Referenced by sample::file_get_contents(), sample::sample_fundamental_types(), and sample::sample_quick_overview().
| bool sample::ErrorHandlerExample::check_assertion_occurs | ( | Fn && | fn | ) | const |
Referenced by sample::sample_quick_overview().
| void sample::ErrorHandlerExample::check_effect | ( | bool | committed | ) | const |
Definition at line 5453 of file quickstart.cpp.
Referenced by sample::ScopedErrorHandlerExample::ScopedErrorHandlerExample(), and sample::ScopedErrorHandlerExample::~ScopedErrorHandlerExample().
|
inline |
Definition at line 255 of file quickstart.cpp.
|
inline |
Definition at line 261 of file quickstart.cpp.
References sample::ErrorHandlerExample::callbacks(), sample::ErrorHandlerExample::check_effect(), and c4::yml::set_callbacks().
|
inline |
Definition at line 262 of file quickstart.cpp.
References sample::ErrorHandlerExample::check_effect(), sample::ErrorHandlerExample::defaults, and c4::yml::set_callbacks().
| void sample::sample_lightning_overview | ( | ) |
a lightning tour over most features see sample_quick_overview
Definition at line 274 of file quickstart.cpp.
References c4::yml::NodeRef::append_child(), CHECK, c4::yml::emit_yaml(), and c4::yml::parse_in_place().
| void sample::sample_quick_overview | ( | ) |
a brief tour over most features
Definition at line 322 of file quickstart.cpp.
References c4::yml::NodeRef::append_child(), c4::yml::Tree::arena(), sample::ErrorHandlerExample::callbacks(), c4::yml::Tree::callbacks(), CHECK, sample::ErrorHandlerExample::check_assertion_occurs(), sample::ErrorHandlerExample::check_error_occurs(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::children(), c4::yml::Location::col, c4::yml::emit_yaml(), c4::yml::Tree::find_child(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::first_child(), c4::yml::Tree::first_child(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::first_sibling(), c4::yml::Tree::first_sibling(), c4::FTOA_FLOAT, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_child(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_key(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_val(), c4::yml::ConstNodeRef::id(), c4::yml::Tree::in_arena(), c4::yml::ConstNodeRef::invalid(), c4::yml::NodeRef::invalid(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_map(), c4::yml::Tree::is_map(), c4::yml::NodeRef::is_seed(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_seq(), c4::yml::Tree::is_seq(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::key(), c4::yml::Tree::key(), c4::yml::key(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::last_child(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::last_sibling(), c4::yml::Location::line, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::location(), c4::yml::ParseEngine< EventHandler >::location_contents(), c4::yml::MAP, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::next_sibling(), c4::yml::Tree::next_sibling(), c4::yml::NONE, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_children(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_siblings(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::parent(), c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::prev_sibling(), c4::yml::ConstNodeRef::readable(), c4::yml::NodeRef::readable(), c4::fmt::real(), c4::yml::Tree::root_id(), c4::yml::Tree::rootref(), c4::yml::SEQ, c4::yml::Tree::size(), c4::to_csubstr(), c4::yml::ConstNodeRef::tree(), and c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val().
| void sample::sample_substr | ( | ) |
demonstrate usage of ryml::substr and ryml::csubstr
These types are imported from the c4core library into the ryml namespace You may have noticed above the use of a csubstr class. This class is defined in another library, c4core, which is imported by ryml. This is a library I use with my projects consisting of multiplatform low-level utilities. One of these is c4::csubstr (the name comes from "constant substring") which is a non-owning read-only string view, with many methods that make it practical to use (I would certainly argue more practical than std::string). In fact, c4::csubstr and its writeable counterpart c4::substr are the workhorses of the ryml parsing and serialization code.
Definition at line 941 of file quickstart.cpp.
References CHECK, c4::yml::npos, c4::to_csubstr(), and c4::to_substr().
| void sample::sample_parse_file | ( | ) |
demonstrate how to load a YAML file from disk to parse with ryml.
ryml offers no overload to directly parse files from disk; it only parses source buffers (which may be mutable or immutable). It is up to the caller to load the file contents into a buffer before parsing with ryml.
But that does not mean that loading a file is unimportant. There are many ways to achieve this in C++, but for convenience and to enable you to quickly get up to speed, here is an example implementation loading a file from disk and then parsing the resulting buffer with ryml.
Definition at line 1748 of file quickstart.cpp.
References CHECK, sample::file_put_contents(), c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::to_csubstr(), and c4::to_substr().
| void sample::sample_parse_in_place | ( | ) |
demonstrate in-place parsing of a mutable YAML source buffer.
Definition at line 1789 of file quickstart.cpp.
References CHECK, c4::yml::Tree::crootref(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_map(), c4::yml::key(), and c4::yml::parse_in_place().
| void sample::sample_parse_in_arena | ( | ) |
demonstrate parsing of a read-only YAML source buffer
Definition at line 1843 of file quickstart.cpp.
References CHECK, c4::yml::Tree::crootref(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_map(), c4::yml::key(), and c4::yml::parse_in_arena().
| void sample::sample_parse_reuse_tree | ( | ) |
demonstrate reuse/modification of tree when parsing
Definition at line 1889 of file quickstart.cpp.
References c4::yml::NodeRef::append_child(), CHECK, c4::yml::Tree::clear(), c4::yml::Tree::clear_arena(), c4::yml::Tree::crootref(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_map(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_seq(), c4::yml::key(), c4::yml::KEY, c4::yml::KEYMAP, c4::yml::KEYSEQ, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_children(), c4::yml::parse_in_arena(), c4::yml::Tree::reserve(), c4::yml::Tree::reserve_arena(), and c4::yml::Tree::rootref().
| void sample::sample_parse_reuse_parser | ( | ) |
Demonstrates reuse of an existing parser.
Doing this is recommended when multiple files are parsed.
Definition at line 2041 of file quickstart.cpp.
References CHECK, c4::yml::parse_in_arena(), and c4::yml::ParseEngine< EventHandler >::reserve_stack().
| void sample::sample_parse_reuse_tree_and_parser | ( | ) |
for ultimate speed when parsing multiple times, reuse both the tree and parser
Definition at line 2068 of file quickstart.cpp.
References CHECK, c4::yml::Tree::clear(), c4::yml::parse_in_arena(), c4::yml::Tree::reserve(), and c4::yml::ParseEngine< EventHandler >::reserve_stack().
| void sample::sample_iterate_trees | ( | ) |
shows how to programatically iterate through trees
Definition at line 2126 of file quickstart.cpp.
References CHECK, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::children(), c4::yml::Tree::crootref(), c4::yml::key(), and c4::yml::parse_in_arena().
| void sample::sample_create_trees | ( | ) |
shows how to programatically create trees
Definition at line 2192 of file quickstart.cpp.
References c4::yml::NodeRef::append_child(), c4::fmt::boolalpha(), CHECK, c4::yml::NodeRef::invalid(), c4::yml::NodeRef::is_seed(), c4::yml::MAP, c4::fmt::real(), c4::yml::Tree::rootref(), c4::yml::SEQ, and c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val().
| void sample::sample_tree_arena | ( | ) |
demonstrates explicit and implicit interaction with the tree's string arena.
Notice that ryml only holds strings in the tree's nodes.
Definition at line 2273 of file quickstart.cpp.
References c4::yml::Tree::alloc_arena(), c4::yml::Tree::arena(), c4::yml::Tree::arena_capacity(), CHECK, c4::yml::Tree::copy_to_arena(), c4::yml::Tree::key(), c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::yml::Tree::reserve_arena(), c4::yml::Tree::rootref(), c4::yml::Tree::set_val(), c4::yml::NodeRef::set_val_serialized(), c4::yml::Tree::to_arena(), c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val(), and c4::yml::Tree::val().
| void sample::sample_fundamental_types | ( | ) |
ryml provides facilities for serializing and deserializing the C++ fundamental types, including boolean and null values; this is provided by the several overloads in to_chars: generalized chars to value and from_chars: generalized chars to value.
To add serialization for user scalar types (ie, those types that should be serialized as strings in leaf nodes), you just need to define the appropriate overloads of to_chars and from_chars for those types; see sample_user_scalar_types for an example on how to achieve this, and see Serialization/deserialization for more information on serialization.
Definition at line 2438 of file quickstart.cpp.
References c4::yml::Tree::arena(), c4::fmt::boolalpha(), sample::ErrorHandlerExample::callbacks(), CHECK, sample::ErrorHandlerExample::check_error_occurs(), c4::yml::parse_in_arena(), and c4::yml::Tree::to_arena().
| void sample::sample_empty_null_values | ( | ) |
Shows how to deal with empty/null values.
See also c4::yml::Tree::val_is_null
Definition at line 2531 of file quickstart.cpp.
References c4::yml::Tree::arena(), CHECK, c4::yml::Tree::clear(), c4::yml::Tree::clear_arena(), c4::yml::MAP, c4::yml::parse_in_arena(), c4::yml::Tree::rootref(), and c4::yml::scalar_is_null().
| void sample::sample_formatting | ( | ) |
ryml provides facilities for formatting/deformatting (imported from c4core into the ryml namespace).
See Format utilities . These functions are very useful to serialize and deserialize scalar types; see Serialization/deserialization .
Definition at line 2698 of file quickstart.cpp.
References c4::fmt::bin, c4::fmt::boolalpha(), c4::cat(), c4::cat_sub(), c4::catrs(), c4::catrs_append(), c4::catsep(), c4::catsep_sub(), c4::catseprs(), c4::catseprs_append(), CHECK, c4::fmt::craw(), c4::format(), c4::format_sub(), c4::formatrs(), c4::formatrs_append(), c4::FTOA_FLEX, c4::FTOA_FLOAT, c4::FTOA_HEXA, c4::FTOA_SCIENT, c4::fmt::hex, c4::fmt::left(), c4::yml::npos, c4::fmt::oct, c4::fmt::raw(), c4::fmt::real(), c4::fmt::right(), c4::to_csubstr(), c4::uncat(), c4::uncatsep(), c4::unformat(), and c4::fmt::zpad().
| void sample::sample_base64 | ( | ) |
demonstrates how to read and write base64-encoded blobs.
Definition at line 3132 of file quickstart.cpp.
References c4::yml::NodeRef::append_child(), c4::fmt::base64(), c4::base64_decode(), CHECK, c4::yml::Tree::key(), c4::yml::key(), c4::yml::MAP, c4::yml::Tree::rootref(), c4::yml::Tree::size(), c4::to_substr(), and c4::yml::Tree::val().
| void sample::sample_user_scalar_types | ( | ) |
to add scalar types (ie leaf types converting to/from string), define the functions above for those types.
See Serialize/deserialize scalar types.
Definition at line 3512 of file quickstart.cpp.
References CHECK, c4::yml::MAP, and c4::yml::Tree::rootref().
| void sample::sample_user_container_types | ( | ) |
shows how to serialize/deserialize container types.
Definition at line 3708 of file quickstart.cpp.
References CHECK, c4::yml::Tree::crootref(), sample::my_type::map, sample::my_map_type< K, V >::map_member, c4::yml::Tree::rootref(), sample::my_type::seq, sample::my_seq_type< T >::seq_member, sample::my_type::v2, sample::my_type::v3, sample::my_type::v4, sample::vec4< T >::w, sample::vec2< T >::x, sample::vec3< T >::x, sample::vec4< T >::x, sample::vec2< T >::y, sample::vec3< T >::y, sample::vec4< T >::y, sample::vec3< T >::z, and sample::vec4< T >::z.
| void sample::sample_std_types | ( | ) |
demonstrates usage with the std implementations provided by ryml in the ryml_std.hpp header
Definition at line 3769 of file quickstart.cpp.
References CHECK, c4::yml::parse_in_place(), c4::yml::Tree::rootref(), and c4::to_substr().
| void sample::sample_float_precision | ( | ) |
control precision of serialized floats
Definition at line 3833 of file quickstart.cpp.
References c4::yml::NodeRef::append_child(), CHECK, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::children(), c4::FTOA_FLOAT, c4::yml::parse_in_arena(), c4::fmt::real(), c4::yml::Tree::rootref(), c4::yml::SEQ, and c4::to_csubstr().
| void sample::sample_emit_to_container | ( | ) |
demonstrates how to emit to a linear container of char
Definition at line 3966 of file quickstart.cpp.
References CHECK, c4::yml::emit_yaml(), c4::yml::emitrs_yaml(), c4::yml::parse_in_arena(), c4::to_csubstr(), and c4::to_substr().
| void sample::sample_emit_to_stream | ( | ) |
demonstrates how to emit to a stream-like structure
Definition at line 4087 of file quickstart.cpp.
References CHECK, c4::yml::parse_in_arena(), and c4::to_csubstr().
| void sample::sample_emit_to_file | ( | ) |
demonstrates how to emit to a FILE*
Definition at line 4151 of file quickstart.cpp.
References CHECK, c4::yml::emit_yaml(), and c4::yml::parse_in_arena().
| void sample::sample_emit_nested_node | ( | ) |
just like parsing into a nested node, you can also emit from a nested node.
Definition at line 4184 of file quickstart.cpp.
References CHECK, and c4::yml::parse_in_arena().
| void sample::sample_style | ( | ) |
[experimental] how to query/set/modify node style.
Definition at line 4226 of file quickstart.cpp.
References c4::yml::BLOCK, CHECK, c4::yml::NodeRef::clear_style(), c4::yml::Tree::clear_style(), c4::yml::FLOW_SL, c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_block(), c4::yml::KEY, c4::yml::KEY_DQUO, c4::yml::KEY_FOLDED, c4::yml::KEY_LITERAL, c4::yml::KEY_PLAIN, c4::yml::KEY_SQUO, c4::yml::KEY_STYLE, c4::yml::parse_in_arena(), c4::yml::Tree::rootref(), c4::yml::Tree::set_container_style(), c4::yml::Tree::set_key_style(), c4::yml::Tree::set_style_conditionally(), c4::yml::Tree::set_val_style(), c4::yml::VAL_DQUO, c4::yml::VAL_PLAIN, and c4::yml::VAL_SQUO.
| void sample::sample_json | ( | ) |
shows how to parse and emit JSON.
To emit YAML parsed from JSON, see also sample_style() for info on clearing the style flags (example below).
Definition at line 4330 of file quickstart.cpp.
| void sample::sample_anchors_and_aliases | ( | ) |
demonstrates usage with anchors and alias references.
Note that dereferencing is opt-in; after parsing, you have to call c4::yml::Tree::resolve() explicitly if you want resolved references in the tree. This method will resolve all references and substitute the anchored values in place of the reference.
The c4::yml::Tree::resolve() method first does a full traversal of the tree to gather all anchors and references in a separate collection, then it goes through that collection to locate the names, which it does by obeying the YAML standard diktat that
> an alias node refers to the most recent node in > the serialization having the specified anchor
So, depending on the number of anchor/alias nodes, this is a potentially expensive operation, with a best-case linear complexity (from the initial traversal) and a worst-case quadratic complexity (if every node has an alias/anchor). This potential cost is the reason for requiring an explicit call to c4::yml::Tree::resolve()
Definition at line 4416 of file quickstart.cpp.
| void sample::sample_anchors_and_aliases_create | ( | ) |
demonstrates how to use the API to programatically create anchors and aliases
Definition at line 4491 of file quickstart.cpp.
References CHECK, c4::yml::parse_in_arena(), c4::yml::Tree::resolve(), and c4::to_csubstr().
| void sample::sample_tags | ( | ) |
Definition at line 4574 of file quickstart.cpp.
| void sample::sample_tag_directives | ( | ) |
Definition at line 4714 of file quickstart.cpp.
| void sample::sample_docs | ( | ) |
Definition at line 4748 of file quickstart.cpp.
| void sample::sample_error_handler | ( | ) |
demonstrates how to set a custom error handler for ryml
Definition at line 4884 of file quickstart.cpp.
| void sample::sample_global_allocator | ( | ) |
demonstrates how to set the global allocator for ryml
Definition at line 4996 of file quickstart.cpp.
References sample::GlobalAllocatorExample::~GlobalAllocatorExample(), sample::GlobalAllocatorExample::alloc_size, sample::GlobalAllocatorExample::allocate(), sample::GlobalAllocatorExample::callbacks(), CHECK, sample::GlobalAllocatorExample::check_and_reset(), sample::GlobalAllocatorExample::corr_size, sample::GlobalAllocatorExample::dealloc_size, sample::GlobalAllocatorExample::free(), sample::GlobalAllocatorExample::memory_pool, sample::GlobalAllocatorExample::num_allocs, sample::GlobalAllocatorExample::num_deallocs, sample::GlobalAllocatorExample::s_allocate(), and sample::GlobalAllocatorExample::s_free().
| void sample::sample_per_tree_allocator | ( | ) |
Definition at line 5119 of file quickstart.cpp.
| void sample::sample_static_trees | ( | ) |
shows how to work around the static initialization order fiasco when using a static-duration ryml tree
Definition at line 5153 of file quickstart.cpp.
| void sample::sample_location_tracking | ( | ) |
demonstrates how to obtain the (zero-based) location of a node from a recently parsed tree
Definition at line 5178 of file quickstart.cpp.
References sample::PerTreeMemoryExample::check_and_reset().
| ryml::Callbacks sample::ErrorHandlerExample::defaults |
Definition at line 256 of file quickstart.cpp.
Referenced by sample::ScopedErrorHandlerExample::~ScopedErrorHandlerExample().