|
rapidyaml
0.12.1
parse and emit YAML, and do it fast
|
A c-style callbacks class to customize behavior on errors or allocation. More...
#include <common.hpp>
Public Member Functions | |
| Callbacks () noexcept | |
| Construct an object with the default callbacks. More... | |
| Callbacks (void *user_data, pfn_allocate alloc, pfn_free free, pfn_error_basic error_basic) | |
| Callbacks & | set_user_data (void *user_data) |
| Set the user data. More... | |
| Callbacks & | set_allocate (pfn_allocate allocate=nullptr) |
| Set or reset the allocate callback. More... | |
| Callbacks & | set_free (pfn_free free=nullptr) |
| Set or reset the free callback. More... | |
| Callbacks & | set_error_basic (pfn_error_basic error_basic=nullptr) |
| Set or reset the error_basic callback. More... | |
| Callbacks & | set_error_parse (pfn_error_parse error_parse=nullptr) |
| Set or reset the error_parse callback. More... | |
| Callbacks & | set_error_visit (pfn_error_visit error_visit=nullptr) |
| Set or reset the error_visit callback. More... | |
| bool | operator!= (Callbacks const &that) const |
| bool | operator== (Callbacks const &that) const |
Public Attributes | |
| void * | m_user_data |
| data to be forwarded in every call to a callback More... | |
| pfn_allocate | m_allocate |
| a pointer to an allocate handler function More... | |
| pfn_free | m_free |
| a pointer to a free handler function More... | |
| pfn_error_basic | m_error_basic |
| a pointer to a basic error handler function More... | |
| pfn_error_parse | m_error_parse |
| a pointer to a parse error handler function More... | |
| pfn_error_visit | m_error_visit |
| a pointer to a visit error handler function More... | |
A c-style callbacks class to customize behavior on errors or allocation.
Can be used globally by the library and/or locally by Tree and Parser objects.
Definition at line 537 of file common.hpp.
|
noexcept |
Construct an object with the default callbacks.
If RYML_NO_DEFAULT_CALLBACKS is defined, the object will be set with null members.
Definition at line 105 of file common.cpp.
| c4::yml::Callbacks::Callbacks | ( | void * | user_data, |
| pfn_allocate | alloc, | ||
| pfn_free | free, | ||
| pfn_error_basic | error_basic | ||
| ) |
Definition at line 124 of file common.cpp.
| Callbacks & c4::yml::Callbacks::set_user_data | ( | void * | user_data | ) |
| Callbacks & c4::yml::Callbacks::set_allocate | ( | pfn_allocate | allocate = nullptr | ) |
Set or reset the allocate callback.
When the parameter is null, m_allocate will fall back to ryml's default allocate implementation, unless RYML_NO_DEFAULT_CALLBACKS is defined.
Definition at line 150 of file common.cpp.
References m_allocate.
Set or reset the free callback.
When the parameter is null, m_free will fall back to ryml's default free implementation, unless RYML_NO_DEFAULT_CALLBACKS is defined.
Definition at line 159 of file common.cpp.
References m_free.
| Callbacks & c4::yml::Callbacks::set_error_basic | ( | pfn_error_basic | error_basic = nullptr | ) |
Set or reset the error_basic callback.
When the parameter is null, m_error_basic will fall back to ryml's default error_basic implementation, unless RYML_NO_DEFAULT_CALLBACKS is defined.
Definition at line 168 of file common.cpp.
References m_error_basic.
| Callbacks & c4::yml::Callbacks::set_error_parse | ( | pfn_error_parse | error_parse = nullptr | ) |
Set or reset the error_parse callback.
When the parameter is null, m_error_parse will fall back to ryml's default error_parse implementation, unless RYML_NO_DEFAULT_CALLBACKS is defined.
Definition at line 177 of file common.cpp.
References m_error_parse.
| Callbacks & c4::yml::Callbacks::set_error_visit | ( | pfn_error_visit | error_visit = nullptr | ) |
Set or reset the error_visit callback.
When the parameter is null, m_error_visit will fall back to ryml's default error_visit implementation, unless RYML_NO_DEFAULT_CALLBACKS is defined.
Definition at line 186 of file common.cpp.
References m_error_visit.
|
inline |
Definition at line 589 of file common.hpp.
References c4::operator==().
|
inline |
Definition at line 590 of file common.hpp.
References m_allocate, m_error_basic, m_error_parse, m_error_visit, m_free, and m_user_data.
| void* c4::yml::Callbacks::m_user_data |
data to be forwarded in every call to a callback
Definition at line 539 of file common.hpp.
| pfn_allocate c4::yml::Callbacks::m_allocate |
a pointer to an allocate handler function
Definition at line 540 of file common.hpp.
| pfn_free c4::yml::Callbacks::m_free |
a pointer to a free handler function
Definition at line 541 of file common.hpp.
| pfn_error_basic c4::yml::Callbacks::m_error_basic |
a pointer to a basic error handler function
Definition at line 542 of file common.hpp.
| pfn_error_parse c4::yml::Callbacks::m_error_parse |
a pointer to a parse error handler function
Definition at line 543 of file common.hpp.
| pfn_error_visit c4::yml::Callbacks::m_error_visit |
a pointer to a visit error handler function
Definition at line 544 of file common.hpp.