|
rapidyaml 0.15.2
parse and emit YAML, and do it fast
|
Helper utilities used in the quickstart. More...
Topics | |
| Serialize/deserialize scalar types | |
| Serialize/deserialize container types | |
Classes | |
| struct | ErrorHandlerExample |
| an error handler used by some of the quickstart examples. More... | |
| struct | ScopedErrorHandlerExample |
| Shows how to create a scoped error handler. More... | |
| struct | GlobalAllocatorExample |
| struct | PerTreeMemoryExample |
| an example for a per-tree memory allocator More... | |
Macros | |
| #define | CHECK(predicate) |
| a testing assertion, used only in this quickstart | |
Functions | |
| bool | report_check (int line, const char *predicate, bool result) |
| used by CHECK() | |
| void | ensure_callbacks () |
| set up default callbacks when ryml does not provide them (ie when RYML_NO_DEFAULT_CALLBACKS is defined) | |
| ryml::Callbacks | default_callbacks () |
| set up a bare-bones implementation of the callbacks | |
| void | handle_args (int argc, const char *argv[]) |
| int | report_checks () |
| template<class Fn> | |
| bool | ErrorHandlerExample::check_assertion_occurs (Fn &&fn) |
| checking that an assertion occurs while calling fn. | |
| template<class Fn> | |
| bool | ErrorHandlerExample::check_error_occurs (Fn &&fn) |
| checking that an error occurs while calling fn | |
| void | ErrorHandlerExample::on_error_basic (ryml::csubstr msg, ryml::ErrorDataBasic const &errdata) |
| this is where the callback implementation goes. | |
| void | ErrorHandlerExample::on_error_parse (ryml::csubstr msg, ryml::ErrorDataParse const &errdata) |
| this is where the callback implementation goes. | |
| void | ErrorHandlerExample::on_error_visit (ryml::csubstr msg, ryml::ErrorDataVisit const &errdata) |
| this is where the callback implementation goes. | |
| static void | ErrorHandlerExample::s_error_basic (ryml::csubstr msg, ryml::ErrorDataBasic const &errdata, void *this_) |
| trampoline function to call the object's method | |
| static void | ErrorHandlerExample::s_error_parse (ryml::csubstr msg, ryml::ErrorDataParse const &errdata, void *this_) |
| trampoline function to call the object's method | |
| static void | ErrorHandlerExample::s_error_visit (ryml::csubstr msg, ryml::ErrorDataVisit const &errdata, void *this_) |
| trampoline function to call the object's method | |
| ryml::Callbacks | ErrorHandlerExample::callbacks () |
| a helper to create the Callbacks object for the custom error handler | |
| void | ErrorHandlerExample::check_enabled () const |
| test that this handler is currently set | |
| void | ErrorHandlerExample::check_disabled () const |
| test that this handler is currently not set | |
Variables | |
| static std::jmp_buf | s_jmp_env |
| static std::string | s_jmp_msg |
Helper utilities used in the quickstart.
| #define CHECK | ( | predicate | ) |
a testing assertion, used only in this quickstart
Definition at line 308 of file quickstart.cpp.
Referenced by GlobalAllocatorExample::check_and_reset(), PerTreeMemoryExample::check_and_reset(), ErrorHandlerExample::check_disabled(), ErrorHandlerExample::check_enabled(), my_map_type< K, V >::check_eq(), my_seq_type< T >::check_eq(), my_type::check_eq(), GlobalAllocatorExample::free(), PerTreeMemoryExample::free(), sample_anchors_and_aliases(), sample_anchors_and_aliases_create(), sample_base64(), sample_create_tree(), sample_create_tree_style(), sample_deserialize_error(), sample_docs(), sample_emit_nested_node(), sample_emit_to_container(), sample_emit_to_stream(), sample_empty_null_values(), sample_error_basic(), sample_error_handler(), sample_error_parse(), sample_error_visit(), sample_error_visit_location(), sample_float_precision(), sample_formatting(), sample_fundamental_types(), sample_global_allocator(), sample_iterate_tree(), sample_json(), sample_lightning_overview(), sample_location_tracking(), sample_parse_file(), sample_parse_in_arena(), sample_parse_in_place(), sample_parse_reuse_parser(), sample_parse_reuse_tree(), sample_parse_reuse_tree_and_parser(), sample_parse_style(), sample_per_tree_allocator(), sample_quick_overview(), sample_serialize_basic(), sample_static_trees(), sample_std_types(), sample_style(), sample_style_flow_formatting(), sample_style_flow_ml_indent(), sample_substr(), sample_tag_directives(), sample_tags(), sample_tree_arena(), sample_user_container_types(), and sample_user_scalar_types().
| bool report_check | ( | int | line, |
| const char * | predicate, | ||
| bool | result ) |
used by CHECK()
Definition at line 7037 of file quickstart.cpp.
| void ensure_callbacks | ( | ) |
set up default callbacks when ryml does not provide them (ie when RYML_NO_DEFAULT_CALLBACKS is defined)
Definition at line 7133 of file quickstart.cpp.
Referenced by main().
| ryml::Callbacks default_callbacks | ( | ) |
set up a bare-bones implementation of the callbacks
The default error callbacks won't be called in this quickstart, because no errors are expected. But we implement them here to show how a bare-bones implementation looks like, and also because they are needed when RYML_NO_DEFAULT_CALLBACKS is defined.
For a different (more involved) implementation of the error callbacks, see the implementation of ErrorHandlerExample below.
Definition at line 7091 of file quickstart.cpp.
Referenced by ensure_callbacks(), and sample_static_trees().
| void handle_args | ( | int | argc, |
| const char * | argv[] ) |
Definition at line 7027 of file quickstart.cpp.
Referenced by main().
| int report_checks | ( | ) |
Definition at line 7054 of file quickstart.cpp.
Referenced by main().
| bool ErrorHandlerExample::check_assertion_occurs | ( | Fn && | fn | ) |
checking that an assertion occurs while calling fn.
assertions are enabled if RYML_USE_ASSERT is defined.
Definition at line 7154 of file quickstart.cpp.
Referenced by sample_quick_overview().
| bool ErrorHandlerExample::check_error_occurs | ( | Fn && | fn | ) |
checking that an error occurs while calling fn
Definition at line 7166 of file quickstart.cpp.
Referenced by check_assertion_occurs(), sample_deserialize_error(), sample_docs(), sample_error_basic(), sample_error_handler(), sample_error_parse(), sample_error_visit(), sample_error_visit_location(), sample_fundamental_types(), and sample_quick_overview().
| void ErrorHandlerExample::on_error_basic | ( | ryml::csubstr | msg, |
| ryml::ErrorDataBasic const & | errdata ) |
this is where the callback implementation goes.
Remember that it must not return.
Definition at line 7214 of file quickstart.cpp.
Referenced by s_error_basic().
| void ErrorHandlerExample::on_error_parse | ( | ryml::csubstr | msg, |
| ryml::ErrorDataParse const & | errdata ) |
this is where the callback implementation goes.
Remember that it must not return.
Definition at line 7230 of file quickstart.cpp.
Referenced by s_error_parse().
| void ErrorHandlerExample::on_error_visit | ( | ryml::csubstr | msg, |
| ryml::ErrorDataVisit const & | errdata ) |
this is where the callback implementation goes.
Remember that it must not return.
Definition at line 7252 of file quickstart.cpp.
Referenced by s_error_visit().
|
static |
trampoline function to call the object's method
Definition at line 7274 of file quickstart.cpp.
Referenced by callbacks(), check_disabled(), and check_enabled().
|
static |
trampoline function to call the object's method
Definition at line 7279 of file quickstart.cpp.
Referenced by callbacks(), check_disabled(), and check_enabled().
|
static |
trampoline function to call the object's method
Definition at line 7284 of file quickstart.cpp.
Referenced by callbacks(), check_disabled(), and check_enabled().
| ryml::Callbacks ErrorHandlerExample::callbacks | ( | ) |
a helper to create the Callbacks object for the custom error handler
Definition at line 7293 of file quickstart.cpp.
Referenced by ScopedErrorHandlerExample::ScopedErrorHandlerExample(), sample_docs(), sample_error_handler(), sample_error_parse(), sample_error_visit(), sample_error_visit_location(), sample_fundamental_types(), and sample_quick_overview().
| void ErrorHandlerExample::check_enabled | ( | ) | const |
test that this handler is currently set
Definition at line 7304 of file quickstart.cpp.
Referenced by ScopedErrorHandlerExample::ScopedErrorHandlerExample(), and sample_error_handler().
| void ErrorHandlerExample::check_disabled | ( | ) | const |
test that this handler is currently not set
Definition at line 7314 of file quickstart.cpp.
Referenced by ScopedErrorHandlerExample::~ScopedErrorHandlerExample(), and sample_error_handler().
|
static |
Definition at line 7146 of file quickstart.cpp.
Referenced by ErrorHandlerExample::check_error_occurs().
|
static |
Definition at line 7147 of file quickstart.cpp.