|
rapidyaml
0.12.0
parse and emit YAML, and do it fast
|
Modules | |
| Emit to resizeable container | |
Functions | |
| bool | c4::yml::EmitOptions::operator== (const EmitOptions &that) const noexcept |
| template<class ... WriterArgs> | |
| c4::yml::Emitter< Writer >::Emitter (EmitOptions const &opts, WriterArgs &&...args) | |
| Construct the emitter and its internal Writer state. More... | |
| template<class ... WriterArgs> | |
| c4::yml::Emitter< Writer >::Emitter (WriterArgs &&...args) | |
| Construct the emitter and its internal Writer state, using default emit options. 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 >::options (EmitOptions opts) noexcept |
| set 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, id_type 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, id_type 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... | |
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 | |
| bool | c4::yml::EmitOptions::emit_nonroot_key () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::emit_nonroot_key (bool enabled) noexcept |
| bool | c4::yml::EmitOptions::emit_nonroot_dash () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::emit_nonroot_dash (bool enabled) noexcept |
| bool | c4::yml::EmitOptions::indent_flow_ml () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::indent_flow_ml (bool enabled) noexcept |
| EmitOptionFlags_e | c4::yml::EmitOptions::json_error_flags () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::json_error_flags (EmitOptionFlags_e d) noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Construct the emitter and its internal Writer state.
| opts | EmitOptions |
| args | arguments to be forwarded to the constructor of the writer. |
|
inline |
Construct the emitter and its internal Writer state, using default emit options.
| 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 (YAML or JSON) |
| 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 20 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().
|
inline |
emit starting at the root node
Definition at line 188 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 195 of file emit.hpp.
References c4::yml::ConstNodeRef::id(), c4::yml::ConstNodeRef::readable(), and c4::yml::ConstNodeRef::tree().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
set the max depth for emitted trees (to prevent a stack overflow)
Definition at line 210 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 625 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 631 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 645 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 651 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 668 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 674 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 687 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 693 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 710 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_YAML, and c4::yml::ConstNodeRef::readable().
|
inline |
(2) like (1), but use default emit options
Definition at line 718 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_YAML, and c4::yml::ConstNodeRef::readable().
|
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 733 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_JSON, and c4::yml::ConstNodeRef::readable().
|
inline |
(2) like (1), but use default emit options
Definition at line 741 of file emit.hpp.
References c4::yml::Emitter< Writer >::emit_as(), c4::yml::EMIT_JSON, and c4::yml::ConstNodeRef::readable().
|
staticconstexpr |
| EmitOptions c4::yml::as_json::options |
| EmitOptions c4::yml::as_yaml::options |