|
rapidyaml
0.10.0
parse and emit YAML, and do it fast
|
Modules | |
| Emit to resizeable container | |
Enumerations | |
| enum | c4::yml::EmitOptions::EmitOptionFlags_e : uint32_t { c4::yml::EmitOptions::DEFAULT_FLAGS = 0u , c4::yml::EmitOptions::JSON_ERR_ON_TAG = 1u << 0u , c4::yml::EmitOptions::JSON_ERR_ON_ANCHOR = 1u << 1u , c4::yml::EmitOptions::_JSON_ERR_MASK = JSON_ERR_ON_TAG|JSON_ERR_ON_ANCHOR } |
Functions | |
| bool | c4::yml::detail::is_set_ (ConstNodeRef n) |
| bool | c4::yml::EmitOptions::operator== (const EmitOptions &that) const noexcept |
| template<class ... Args> | |
| c4::yml::Emitter< Writer >::Emitter (Args &&...args) | |
| Construct the emitter and its internal Writer state, using default emit options. More... | |
| template<class ... Args> | |
| c4::yml::Emitter< Writer >::Emitter (EmitOptions const &opts, Args &&...args) | |
| Construct the emitter and its internal Writer state. More... | |
| substr | c4::yml::Emitter< Writer >::emit_as (EmitType_e type, Tree const &t, id_type id, bool error_on_excess) |
| emit! More... | |
| substr | c4::yml::Emitter< Writer >::emit_as (EmitType_e type, Tree const &t, bool error_on_excess=true) |
| emit starting at the root node More... | |
| substr | c4::yml::Emitter< Writer >::emit_as (EmitType_e type, ConstNodeRef const &n, bool error_on_excess=true) |
| emit starting at the given node More... | |
| EmitOptions const & | c4::yml::Emitter< Writer >::options () const noexcept |
| get the emit options for this object More... | |
| void | c4::yml::Emitter< Writer >::max_depth (id_type max_depth) noexcept |
| set the max depth for emitted trees (to prevent a stack overflow) More... | |
| id_type | c4::yml::Emitter< Writer >::max_depth () const noexcept |
| get the max depth for emitted trees (to prevent a stack overflow) More... | |
| c4::yml::as_json::as_json (Tree const &t, EmitOptions const &opts={}) | |
| c4::yml::as_json::as_json (Tree const &t, size_t id, EmitOptions const &opts={}) | |
| c4::yml::as_json::as_json (ConstNodeRef const &n, EmitOptions const &opts={}) | |
| c4::yml::as_yaml::as_yaml (Tree const &t, EmitOptions const &opts={}) | |
| c4::yml::as_yaml::as_yaml (Tree const &t, size_t id, EmitOptions const &opts={}) | |
| c4::yml::as_yaml::as_yaml (ConstNodeRef const &n, EmitOptions const &opts={}) | |
| substr | c4::yml::emit_yaml (Tree const &t, id_type id, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit YAML to the given buffer. More... | |
| substr | c4::yml::emit_yaml (Tree const &t, id_type id, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | c4::yml::emit_json (Tree const &t, id_type id, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit JSON to the given buffer. More... | |
| substr | c4::yml::emit_json (Tree const &t, id_type id, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | c4::yml::emit_yaml (Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit YAML to the given buffer. More... | |
| substr | c4::yml::emit_yaml (Tree const &t, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | c4::yml::emit_json (Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit JSON to the given buffer. More... | |
| substr | c4::yml::emit_json (Tree const &t, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | c4::yml::emit_yaml (ConstNodeRef const &r, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit YAML to the given buffer. More... | |
| substr | c4::yml::emit_yaml (ConstNodeRef const &r, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | c4::yml::emit_json (ConstNodeRef const &r, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit JSON to the given buffer. More... | |
| substr | c4::yml::emit_json (ConstNodeRef const &r, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
Variables | |
| Tree const * | c4::yml::as_json::tree |
| size_t | c4::yml::as_json::node |
| EmitOptions | c4::yml::as_json::options |
| Tree const * | c4::yml::as_yaml::tree |
| size_t | c4::yml::as_yaml::node |
| EmitOptions | c4::yml::as_yaml::options |
max depth for the emitted tree | |
This makes the emitter fail when emitting trees exceeding the max_depth. | |
| static constexpr const id_type | c4::yml::EmitOptions::max_depth_default = 64 |
| id_type | c4::yml::EmitOptions::max_depth () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::max_depth (id_type d) noexcept |
option flags | |
| EmitOptionFlags_e | c4::yml::EmitOptions::json_error_flags () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::json_error_flags (EmitOptionFlags_e d) noexcept |
| enum c4::yml::EmitOptions::EmitOptionFlags_e : uint32_t |
|
inline |
Definition at line 42 of file emit.hpp.
References c4::yml::ConstNodeRef::id(), c4::yml::NONE, and c4::yml::ConstNodeRef::tree().
Referenced by c4::yml::Emitter< Writer >::emit_as(), c4::yml::emit_json(), c4::yml::emit_yaml(), c4::yml::emitrs_json(), c4::yml::emitrs_yaml(), and c4::yml::operator<<().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
Construct the emitter and its internal Writer state.
| opts | EmitOptions |
| args | arguments to be forwarded to the constructor of the writer. |
| substr c4::yml::Emitter< Writer >::emit_as | ( | EmitType_e | type, |
| Tree const & | t, | ||
| id_type | id, | ||
| bool | error_on_excess | ||
| ) |
emit!
When writing to a buffer, returns a substr of the emitted YAML. If the given buffer has insufficient space, the returned substr will be null and its size will be the needed space. Whatever the size of the buffer, it is guaranteed that no writes are done past its end.
When writing to a file, the returned substr will be null, but its length will be set to the number of bytes written.
| type | specify what to emit |
| t | the tree to emit |
| id | the id of the node to emit |
| error_on_excess | when true, an error is raised when the output buffer is too small for the emitted YAML/JSON |
Definition at line 17 of file emit.def.hpp.
References c4::yml::Tree::callbacks(), c4::yml::Tree::capacity(), c4::yml::EMIT_JSON, c4::yml::EMIT_YAML, c4::yml::Tree::empty(), c4::yml::NONE, and c4::yml::Tree::root_id().
Referenced by c4::yml::emit_json(), c4::yml::emit_yaml(), and c4::yml::operator<<().
|
inline |
emit starting at the root node
Definition at line 154 of file emit.hpp.
References c4::yml::Tree::empty(), and c4::yml::Tree::root_id().
|
inline |
emit starting at the given node
Definition at line 161 of file emit.hpp.
References c4::yml::Tree::callbacks(), c4::yml::ConstNodeRef::id(), c4::yml::detail::is_set_(), c4::yml::ConstNodeRef::readable(), and c4::yml::ConstNodeRef::tree().
|
inlinenoexcept |
|
inlinenoexcept |
set the max depth for emitted trees (to prevent a stack overflow)
Definition at line 175 of file emit.hpp.
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
(1) emit YAML to the given buffer.
Return a substr trimmed to the emitted YAML.
| t | the tree to emit. |
| id | the node where to start emitting. |
| opts | emit options. |
| buf | the output buffer. |
| error_on_excess | Raise an error if the space in the buffer is insufficient. |
Definition at line 466 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_YAML.
|
inline |
(2) like (1), but use default emit options
Definition at line 472 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_YAML.
|
inline |
(1) emit JSON to the given buffer.
Return a substr trimmed to the emitted JSON.
| t | the tree to emit. |
| id | the node where to start emitting. |
| opts | emit options. |
| buf | the output buffer. |
| error_on_excess | Raise an error if the space in the buffer is insufficient. |
Definition at line 486 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_JSON.
|
inline |
(2) like (1), but use default emit options
Definition at line 492 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_JSON.
|
inline |
(1) emit YAML to the given buffer.
Return a substr trimmed to the emitted YAML.
| t | the tree; will be emitted from the root node. |
| opts | emit options. |
| buf | the output buffer. |
| error_on_excess | Raise an error if the space in the buffer is insufficient. |
Definition at line 509 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_YAML.
|
inline |
(2) like (1), but use default emit options
Definition at line 515 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_YAML.
|
inline |
(1) emit JSON to the given buffer.
Return a substr trimmed to the emitted JSON.
| t | the tree; will be emitted from the root node. |
| opts | emit options. |
| buf | the output buffer. |
| error_on_excess | Raise an error if the space in the buffer is insufficient. |
Definition at line 528 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_JSON.
|
inline |
(2) like (1), but use default emit options
Definition at line 534 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EMIT_JSON.
|
inline |
(1) emit YAML to the given buffer.
Return a substr trimmed to the emitted YAML.
| r | the starting node. |
| buf | the output buffer. |
| opts | emit options. |
| error_on_excess | Raise an error if the space in the buffer is insufficient. |
Definition at line 551 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_YAML, and c4::yml::detail::is_set_().
|
inline |
(2) like (1), but use default emit options
Definition at line 559 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_YAML, and c4::yml::detail::is_set_().
Referenced by c4::yml::emitrs_yaml().
|
inline |
(1) emit JSON to the given buffer.
Return a substr trimmed to the emitted JSON.
| r | the starting node. |
| buf | the output buffer. |
| opts | emit options. |
| error_on_excess | Raise an error if the space in the buffer is insufficient. |
Definition at line 574 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_JSON, and c4::yml::detail::is_set_().
|
inline |
(2) like (1), but use default emit options
Definition at line 582 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_JSON, and c4::yml::detail::is_set_().
Referenced by c4::yml::emitrs_json().
|
staticconstexpr |
| Tree const* c4::yml::as_json::tree |
Definition at line 394 of file emit.hpp.
Referenced by c4::yml::operator<<().
| size_t c4::yml::as_json::node |
Definition at line 395 of file emit.hpp.
Referenced by c4::yml::operator<<().
| EmitOptions c4::yml::as_json::options |
Definition at line 396 of file emit.hpp.
Referenced by c4::yml::operator<<().
| Tree const* c4::yml::as_yaml::tree |
Definition at line 415 of file emit.hpp.
Referenced by c4::yml::operator<<().
| size_t c4::yml::as_yaml::node |
Definition at line 416 of file emit.hpp.
Referenced by c4::yml::operator<<().
| EmitOptions c4::yml::as_yaml::options |
Definition at line 417 of file emit.hpp.
Referenced by c4::yml::operator<<().