rapidyaml 0.14.0
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
ErrorHandlerExample Struct Reference

an example error handler, required for some of the quickstart examples. More...

Public Member Functions

 ErrorHandlerExample ()
template<class Fn>
bool check_error_occurs (Fn &&fn)
 checking that an error occurs while calling fn
template<class Fn>
bool check_assertion_occurs (Fn &&fn)
 checking that an assertion occurs while calling fn.
void check_enabled () const
 test that this handler is currently set
void check_disabled () const
 test that this handler is currently not set
ryml::Callbacks callbacks ()
 a helper to create the Callbacks object for the custom error handler
void on_error_basic (ryml::csubstr msg, ryml::ErrorDataBasic const &errdata)
 this is where the callback implementation goes.
void on_error_parse (ryml::csubstr msg, ryml::ErrorDataParse const &errdata)
 this is where the callback implementation goes.
void on_error_visit (ryml::csubstr msg, ryml::ErrorDataVisit const &errdata)
 this is where the callback implementation goes.

Static Public Member Functions

static void s_error_basic (ryml::csubstr msg, ryml::ErrorDataBasic const &errdata, void *this_)
 trampoline function to call the object's method
static void s_error_parse (ryml::csubstr msg, ryml::ErrorDataParse const &errdata, void *this_)
 trampoline function to call the object's method
static void s_error_visit (ryml::csubstr msg, ryml::ErrorDataVisit const &errdata, void *this_)
 trampoline function to call the object's method

Public Attributes

ryml::Callbacks original_callbacks
std::string saved_msg_short
std::string saved_msg_full
std::string saved_msg_full_with_context
ryml::Location saved_basic_loc
ryml::Location saved_parse_loc
ryml::Tree const * saved_visit_tree
ryml::id_type saved_visit_id

Detailed Description

an example error handler, required for some of the quickstart examples.

Definition at line 243 of file quickstart.cpp.

Constructor & Destructor Documentation

◆ ErrorHandlerExample()

ErrorHandlerExample::ErrorHandlerExample ( )
inline

Definition at line 245 of file quickstart.cpp.

Callbacks const & get_callbacks()
get the global callbacks
Definition common.cpp:94
ryml::Callbacks original_callbacks

Member Data Documentation

◆ original_callbacks

ryml::Callbacks ErrorHandlerExample::original_callbacks

Definition at line 246 of file quickstart.cpp.

◆ saved_msg_short

std::string ErrorHandlerExample::saved_msg_short

Definition at line 268 of file quickstart.cpp.

◆ saved_msg_full

std::string ErrorHandlerExample::saved_msg_full

Definition at line 269 of file quickstart.cpp.

◆ saved_msg_full_with_context

std::string ErrorHandlerExample::saved_msg_full_with_context

Definition at line 270 of file quickstart.cpp.

◆ saved_basic_loc

ryml::Location ErrorHandlerExample::saved_basic_loc

Definition at line 271 of file quickstart.cpp.

◆ saved_parse_loc

ryml::Location ErrorHandlerExample::saved_parse_loc

Definition at line 272 of file quickstart.cpp.

◆ saved_visit_tree

ryml::Tree const* ErrorHandlerExample::saved_visit_tree

Definition at line 273 of file quickstart.cpp.

◆ saved_visit_id

ryml::id_type ErrorHandlerExample::saved_visit_id

Definition at line 274 of file quickstart.cpp.


The documentation for this struct was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/v0.14.0/samples/quickstart.cpp