|
rapidyaml 0.15.0
parse and emit YAML, and do it fast
|
Topics | |
| 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. | |
| template<class ... WriterArgs> | |
| c4::yml::Emitter< Writer >::Emitter (WriterArgs &&...args) | |
| Construct the emitter and its internal Writer state, using default emit options. | |
| substr | c4::yml::Emitter< Writer >::emit_as (EmitType_e type, Tree const &t, id_type id, bool error_on_excess) |
| emit! | |
| substr | c4::yml::Emitter< Writer >::emit_as (EmitType_e type, Tree const &t, bool error_on_excess=true) |
| emit starting at the root node | |
| substr | c4::yml::Emitter< Writer >::emit_as (EmitType_e type, ConstNodeRef const &n, bool error_on_excess=true) |
| emit starting at the given node | |
| EmitOptions const & | c4::yml::Emitter< Writer >::options () const noexcept |
| get the emit options for this object | |
| void | c4::yml::Emitter< Writer >::options (EmitOptions opts) noexcept |
| set the emit options for this object | |
| void | c4::yml::Emitter< Writer >::max_depth (id_type max_depth) noexcept |
| set the max depth for emitted trees (to prevent a stack overflow) | |
| id_type | c4::yml::Emitter< Writer >::max_depth () const noexcept |
| get the max depth for emitted trees (to prevent a stack overflow) | |
| Pws_e | c4::yml::Emitter< Writer >::flow_pws::next_pws (size_t col) const noexcept |
| void | c4::yml::Emitter< Writer >::flow_pws::start (NodeType ty, size_t max_cols_) noexcept |
| void | c4::yml::Emitter< Writer >::flow_pws::stop () noexcept |
| 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. | |
| 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 | |
| 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. | |
| 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 | |
| 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. | |
| substr | c4::yml::emit_yaml (Tree const &t, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options | |
| 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. | |
| substr | c4::yml::emit_json (Tree const &t, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options | |
| 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. | |
| substr | c4::yml::emit_yaml (ConstNodeRef const &r, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options | |
| 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. | |
| substr | c4::yml::emit_json (ConstNodeRef const &r, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options | |
Variables | |
| size_t | c4::yml::Emitter< Writer >::flow_pws::max_cols = 0 |
| Pws_e | c4::yml::Emitter< Writer >::flow_pws::pend_after_comma = _PWS_NONE |
| bool | c4::yml::Emitter< Writer >::flow_pws::active = false |
| Tree const * | c4::yml::as_json::tree |
| id_type | c4::yml::as_json::node |
| EmitOptions | c4::yml::as_json::options |
| Tree const * | c4::yml::as_yaml::tree |
| id_type | c4::yml::as_yaml::node |
| EmitOptions | c4::yml::as_yaml::options |
flow customization | |
| static constexpr const id_type | c4::yml::EmitOptions::max_cols_default = 80 |
| bool | c4::yml::EmitOptions::indent_flow_ml () const noexcept |
| Indent the contents of FLOW_ML1 and FLOW_MLN containers. | |
| EmitOptions & | c4::yml::EmitOptions::indent_flow_ml (bool enabled) noexcept |
| EmitOptions & | c4::yml::EmitOptions::force_flow_spc (bool enabled) noexcept |
| Force everywhere a space after comma in flow mode, overriding the FLOW_SPC status of individual containers. | |
| bool | c4::yml::EmitOptions::force_flow_spc () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::max_cols (id_type cols) noexcept |
| Set max columns for the emitted YAML in FLOW_MLN mode. | |
| id_type | c4::yml::EmitOptions::max_cols () const noexcept |
maximum depth for the emitted tree | |
This prevents stack overflows by making the emitter fail when the tree exceeds the maximum 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 - control emission of non-root (nested) nodes | |
| EmitOptions & | c4::yml::EmitOptions::emit_nonroot_key (bool enabled) noexcept |
| When emit starts on a node which is not the root node, emit the node key as well. | |
| bool | c4::yml::EmitOptions::emit_nonroot_key () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::emit_nonroot_dash (bool enabled) noexcept |
| When emit starts on a node which is not the root node, emit a leading dash. | |
| bool | c4::yml::EmitOptions::emit_nonroot_dash () const noexcept |
option flags - json behavior | |
| EmitOptions & | c4::yml::EmitOptions::json_err_on_tag (bool enabled) noexcept |
| Whether to trigger an error (or ignore the tag) when finding a tag in json mode. | |
| bool | c4::yml::EmitOptions::json_err_on_tag () const noexcept |
| EmitOptions & | c4::yml::EmitOptions::json_err_on_anchor (bool enabled) noexcept |
| Whether to trigger an error (or ignore the anchor) when finding an anchor in json mode. | |
| bool | c4::yml::EmitOptions::json_err_on_anchor () const noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
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. |
Definition at line 207 of file emit.hpp.
|
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.
|
inline |
emit starting at the root node
Definition at line 254 of file emit.hpp.
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
set the max depth for emitted trees (to prevent a stack overflow)
Definition at line 276 of file emit.hpp.
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
|
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. |
|
inline |
(2) like (1), but use default emit options
|
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. |
|
inline |
(2) like (1), but use default emit options
|
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. |
(2) like (1), but use default emit options
|
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. |
(2) like (1), but use default emit options
|
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. |
|
inline |
(2) like (1), but use default emit options
|
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. |
|
inline |
(2) like (1), but use default emit options
|
staticconstexpr |
|
staticconstexpr |
| size_t c4::yml::Emitter< Writer >::flow_pws::max_cols = 0 |
| Pws_e c4::yml::Emitter< Writer >::flow_pws::pend_after_comma = _PWS_NONE |
| bool c4::yml::Emitter< Writer >::flow_pws::active = false |
| EmitOptions c4::yml::as_json::options |
| EmitOptions c4::yml::as_yaml::options |