|
rapidyaml
0.11.1
parse and emit YAML, and do it fast
|
Helper utilities used in the sample. More...
Modules | |
| Serialize/deserialize scalar types | |
| Serialize/deserialize container types | |
| To serialize/deserialize container types to a tree, implement the appropriate functions: | |
Classes | |
| struct | ErrorHandlerExample |
| an example error handler, required for 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) assert(predicate) |
| a quick'n'dirty assertion to verify a predicate More... | |
Functions | |
| void | ensure_callbacks () |
| set up default callbacks when ryml does not provide them (ie when RYML_NO_DEFAULT_CALLBACKS is defined) More... | |
| ryml::Callbacks | default_callbacks () |
| a bare-bones implementation of the callbacks More... | |
| template<class CharContainer > | |
| CharContainer | file_get_contents (const char *filename) |
| load a file from disk and return a newly created CharContainer More... | |
| template<class CharContainer > | |
| size_t | file_get_contents (const char *filename, CharContainer *v) |
| load a file from disk into an existing CharContainer More... | |
| template<class CharContainer > | |
| void | file_put_contents (const char *filename, CharContainer const &v, const char *access) |
| save a buffer into a file More... | |
| void | file_put_contents (const char *filename, const char *buf, size_t sz, const char *access) |
| save a buffer into a file More... | |
| bool | report_check (int line, const char *predicate, bool result) |
| int | report_checks () |
| template<class Fn > | |
| bool | ErrorHandlerExample::check_assertion_occurs (Fn &&fn) |
| checking that an assertion occurs while calling fn. More... | |
| template<class Fn > | |
| bool | ErrorHandlerExample::check_error_occurs (Fn &&fn) |
| checking that an error occurs while calling fn More... | |
| void | ErrorHandlerExample::on_error_basic (ryml::csubstr msg, ryml::ErrorDataBasic const &errdata) |
| this is where the callback implementation goes. More... | |
| void | ErrorHandlerExample::on_error_parse (ryml::csubstr msg, ryml::ErrorDataParse const &errdata) |
| this is where the callback implementation goes. More... | |
| void | ErrorHandlerExample::on_error_visit (ryml::csubstr msg, ryml::ErrorDataVisit const &errdata) |
| this is where the callback implementation goes. More... | |
| static void | ErrorHandlerExample::s_error_basic (ryml::csubstr msg, ryml::ErrorDataBasic const &errdata, void *this_) |
| trampoline function to call the object's method More... | |
| static void | ErrorHandlerExample::s_error_parse (ryml::csubstr msg, ryml::ErrorDataParse const &errdata, void *this_) |
| trampoline function to call the object's method More... | |
| static void | ErrorHandlerExample::s_error_visit (ryml::csubstr msg, ryml::ErrorDataVisit const &errdata, void *this_) |
| trampoline function to call the object's method More... | |
| ryml::Callbacks | ErrorHandlerExample::callbacks () |
| a helper to create the Callbacks object for the custom error handler More... | |
| void | ErrorHandlerExample::check_enabled () const |
| test that this handler is currently set More... | |
| void | ErrorHandlerExample::check_disabled () const |
| test that this handler is currently not set More... | |
Variables | |
| static std::jmp_buf | s_jmp_env |
| static std::string | s_jmp_msg |
Helper utilities used in the sample.
| #define CHECK | ( | predicate | ) | assert(predicate) |
a quick'n'dirty assertion to verify a predicate
Definition at line 294 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 6094 of file quickstart.cpp.
| ryml::Callbacks default_callbacks | ( | ) |
| CharContainer file_get_contents | ( | const char * | filename | ) |
load a file from disk and return a newly created CharContainer
Definition at line 6312 of file quickstart.cpp.
| size_t file_get_contents | ( | const char * | filename, |
| CharContainer * | v | ||
| ) |
load a file from disk into an existing CharContainer
Definition at line 6293 of file quickstart.cpp.
| void file_put_contents | ( | const char * | filename, |
| CharContainer const & | v, | ||
| const char * | access = "wb" |
||
| ) |
save a buffer into a file
Definition at line 6321 of file quickstart.cpp.
References ErrorHandlerExample::saved_msg_short.
| void file_put_contents | ( | const char * | filename, |
| const char * | buf, | ||
| size_t | sz, | ||
| const char * | access | ||
| ) |
save a buffer into a file
Definition at line 6327 of file quickstart.cpp.
References ErrorHandlerExample::saved_msg_full.
| bool report_check | ( | int | line, |
| const char * | predicate, | ||
| bool | result | ||
| ) |
Definition at line 6003 of file quickstart.cpp.
| int report_checks | ( | ) |
Definition at line 6017 of file quickstart.cpp.
| 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 6115 of file quickstart.cpp.
| bool ErrorHandlerExample::check_error_occurs | ( | Fn && | fn | ) |
| 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 6175 of file quickstart.cpp.
| 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 6191 of file quickstart.cpp.
| 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 6213 of file quickstart.cpp.
References c4::yml::err_basic_format().
|
static |
trampoline function to call the object's method
Definition at line 6235 of file quickstart.cpp.
|
static |
trampoline function to call the object's method
Definition at line 6240 of file quickstart.cpp.
|
static |
trampoline function to call the object's method
Definition at line 6245 of file quickstart.cpp.
| ryml::Callbacks ErrorHandlerExample::callbacks | ( | ) |
a helper to create the Callbacks object for the custom error handler
Definition at line 6254 of file quickstart.cpp.
| void ErrorHandlerExample::check_enabled | ( | ) | const |
test that this handler is currently set
Definition at line 6265 of file quickstart.cpp.
References ErrorHandlerExample::check_error_occurs().
| void ErrorHandlerExample::check_disabled | ( | ) | const |
test that this handler is currently not set
Definition at line 6275 of file quickstart.cpp.
References c4::yml::NONE, ErrorHandlerExample::saved_basic_loc, ErrorHandlerExample::saved_msg_full, ErrorHandlerExample::saved_msg_full_with_context, ErrorHandlerExample::saved_msg_short, ErrorHandlerExample::saved_parse_loc, ErrorHandlerExample::saved_visit_id, and ErrorHandlerExample::saved_visit_tree.
|
static |
Definition at line 6107 of file quickstart.cpp.
|
static |
Definition at line 6108 of file quickstart.cpp.