|
rapidyaml
0.7.1
parse and emit YAML, and do it fast
|
A reference to a node in an existing yaml tree, offering a more convenient API than the index-based API used in the tree. More...
#include <node.hpp>
Public Types | |
| using | tree_type = Tree |
| using | base_type = detail::RoNodeMethods< NodeRef, ConstNodeRef > |
Public Member Functions | |
construction | |
| NodeRef () noexcept | |
| NodeRef (Tree &t) noexcept | |
| NodeRef (Tree *t) noexcept | |
| NodeRef (Tree *t, id_type id) noexcept | |
| NodeRef (Tree *t, id_type id, id_type seed_pos) noexcept | |
| NodeRef (Tree *t, id_type id, csubstr seed_key) noexcept | |
| NodeRef (std::nullptr_t) noexcept | |
| void | _clear_seed () noexcept |
assignment | |
| NodeRef (NodeRef const &) noexcept=default | |
| NodeRef (NodeRef &&) noexcept=default | |
| NodeRef & | operator= (NodeRef const &) noexcept=default |
| NodeRef & | operator= (NodeRef &&) noexcept=default |
state_queries | |
| bool | invalid () const noexcept |
| true if the object is not referring to any existing or seed node. More... | |
| bool | is_seed () const noexcept |
| true if the object is not invalid and in seed state. More... | |
| bool | readable () const noexcept |
| true if the object is not invalid and not in seed state. More... | |
| bool | valid () const |
comparisons | |
| bool | operator== (NodeRef const &that) const |
| bool | operator!= (NodeRef const &that) const |
| bool | operator== (ConstNodeRef const &that) const |
| bool | operator!= (ConstNodeRef const &that) const |
node_property_getters | |
| Tree * | tree () noexcept |
| Tree const * | tree () const noexcept |
| id_type | id () const noexcept |
node_modifiers | |
| void | create () |
| void | change_type (NodeType t) |
| void | set_type (NodeType t) |
| void | set_key (csubstr key) |
| void | set_val (csubstr val) |
| void | set_key_tag (csubstr key_tag) |
| void | set_val_tag (csubstr val_tag) |
| void | set_key_anchor (csubstr key_anchor) |
| void | set_val_anchor (csubstr val_anchor) |
| void | set_key_ref (csubstr key_ref) |
| void | set_val_ref (csubstr val_ref) |
| void | set_container_style (NodeType_e style) |
| void | set_key_style (NodeType_e style) |
| void | set_val_style (NodeType_e style) |
| void | clear () |
| void | clear_key () |
| void | clear_val () |
| void | clear_children () |
| void | operator= (NodeType_e t) |
| void | operator|= (NodeType_e t) |
| void | operator= (NodeInit const &v) |
| void | operator= (NodeScalar const &v) |
| void | operator= (std::nullptr_t) |
| void | operator= (csubstr v) |
| template<size_t N> | |
| void | operator= (const char(&v)[N]) |
serialization | |
| template<class T > | |
| csubstr | to_arena (T const &s) |
| serialize a variable to the arena More... | |
| template<class T > | |
| size_t | set_key_serialized (T const &k) |
| size_t | set_key_serialized (std::nullptr_t) |
| template<class T > | |
| size_t | set_val_serialized (T const &v) |
| size_t | set_val_serialized (std::nullptr_t) |
| size_t | set_key_serialized (fmt::const_base64_wrapper w) |
| encode a blob as base64 into the tree's arena, then assign the result to the node's key More... | |
| size_t | set_val_serialized (fmt::const_base64_wrapper w) |
| encode a blob as base64 into the tree's arena, then assign the result to the node's val More... | |
| NodeRef & | operator<< (csubstr s) |
| serialize a variable, then assign the result to the node's val More... | |
| template<class T > | |
| NodeRef & | operator<< (T const &v) |
| template<class T > | |
| NodeRef & | operator<< (Key< const T > const &v) |
| serialize a variable, then assign the result to the node's key More... | |
| template<class T > | |
| NodeRef & | operator<< (Key< T > const &v) |
| serialize a variable, then assign the result to the node's key More... | |
| NodeRef & | operator<< (Key< fmt::const_base64_wrapper > w) |
| NodeRef & | operator<< (fmt::const_base64_wrapper w) |
modification of hierarchy | |
| NodeRef | insert_child (NodeRef after) |
| NodeRef | insert_child (NodeInit const &i, NodeRef after) |
| NodeRef | prepend_child () |
| NodeRef | prepend_child (NodeInit const &i) |
| NodeRef | append_child () |
| NodeRef | append_child (NodeInit const &i) |
| NodeRef | insert_sibling (ConstNodeRef const &after) |
| NodeRef | insert_sibling (NodeInit const &i, ConstNodeRef const &after) |
| NodeRef | prepend_sibling () |
| NodeRef | prepend_sibling (NodeInit const &i) |
| NodeRef | append_sibling () |
| NodeRef | append_sibling (NodeInit const &i) |
| void | remove_child (NodeRef &child) |
| void | remove_child (id_type pos) |
| remove the nth child of this node More... | |
| void | remove_child (csubstr key) |
| remove a child by name More... | |
| void | move (ConstNodeRef const &after) |
change the node's position within its parent, placing it after after. More... | |
| void | move (NodeRef const &parent, ConstNodeRef const &after) |
move the node to a different parent (which may belong to a different tree), placing it after after. More... | |
| NodeRef | duplicate (ConstNodeRef const &after) const |
duplicate the current node somewhere within its parent, and place it after the node after. More... | |
| NodeRef | duplicate (NodeRef const &parent, ConstNodeRef const &after) const |
duplicate the current node somewhere into a different parent (possibly from a different tree), and place it after the node after. More... | |
| void | duplicate_children (NodeRef const &parent, ConstNodeRef const &after) const |
node property getters | |
| NodeData const * | get () const RYML_NOEXCEPT |
| returns the data or null when the id is NONE More... | |
| auto | get () RYML_NOEXCEPT -> NodeData * |
| returns the data or null when the id is NONE More... | |
| NodeType | type () const RYML_NOEXCEPT |
| Forward to Tree::type_str(). More... | |
| const char * | type_str () const RYML_NOEXCEPT |
| Forward to Tree::type_str(). More... | |
| csubstr | key () const RYML_NOEXCEPT |
| Forward to Tree::key(). More... | |
| csubstr | key_tag () const RYML_NOEXCEPT |
| Forward to Tree::key_tag(). More... | |
| csubstr | key_ref () const RYML_NOEXCEPT |
| Forward to Tree::key_ref(). More... | |
| csubstr | key_anchor () const RYML_NOEXCEPT |
| Forward to Tree::key_anchor(). More... | |
| csubstr | val () const RYML_NOEXCEPT |
| Forward to Tree::val(). More... | |
| csubstr | val_tag () const RYML_NOEXCEPT |
| Forward to Tree::val_tag(). More... | |
| csubstr | val_ref () const RYML_NOEXCEPT |
| Forward to Tree::val_ref(). More... | |
| csubstr | val_anchor () const RYML_NOEXCEPT |
| Forward to Tree::val_anchor(). More... | |
| NodeScalar const & | keysc () const RYML_NOEXCEPT |
| Forward to Tree::keysc(). More... | |
| NodeScalar const & | valsc () const RYML_NOEXCEPT |
| Forward to Tree::valsc(). More... | |
| bool | key_is_null () const RYML_NOEXCEPT |
| Forward to Tree::key_is_null(). More... | |
| bool | val_is_null () const RYML_NOEXCEPT |
| Forward to Tree::val_is_null(). More... | |
| bool | is_key_unfiltered () const noexcept |
| Forward to Tree::is_key_unfiltered(). More... | |
| bool | is_val_unfiltered () const noexcept |
| Forward to Tree::is_val_unfiltered(). More... | |
node type predicates | |
| bool | empty () const RYML_NOEXCEPT |
| Forward to Tree::empty(). More... | |
| bool | is_stream () const RYML_NOEXCEPT |
| Forward to Tree::is_stream(). More... | |
| bool | is_doc () const RYML_NOEXCEPT |
| Forward to Tree::is_doc(). More... | |
| bool | is_container () const RYML_NOEXCEPT |
| Forward to Tree::is_container(). More... | |
| bool | is_map () const RYML_NOEXCEPT |
| Forward to Tree::is_map(). More... | |
| bool | is_seq () const RYML_NOEXCEPT |
| Forward to Tree::is_seq(). More... | |
| bool | has_val () const RYML_NOEXCEPT |
| Forward to Tree::has_val(). More... | |
| bool | has_key () const RYML_NOEXCEPT |
| Forward to Tree::has_key(). More... | |
| bool | is_val () const RYML_NOEXCEPT |
| Forward to Tree::is_val(). More... | |
| bool | is_keyval () const RYML_NOEXCEPT |
| Forward to Tree::is_keyval(). More... | |
| bool | has_key_tag () const RYML_NOEXCEPT |
| Forward to Tree::has_key_tag(). More... | |
| bool | has_val_tag () const RYML_NOEXCEPT |
| Forward to Tree::has_val_tag(). More... | |
| bool | has_key_anchor () const RYML_NOEXCEPT |
| Forward to Tree::has_key_anchor(). More... | |
| bool | has_val_anchor () const RYML_NOEXCEPT |
| Forward to Tree::has_val_anchor(). More... | |
| bool | has_anchor () const RYML_NOEXCEPT |
| Forward to Tree::has_anchor(). More... | |
| bool | is_key_ref () const RYML_NOEXCEPT |
| Forward to Tree::is_key_ref(). More... | |
| bool | is_val_ref () const RYML_NOEXCEPT |
| Forward to Tree::is_val_ref(). More... | |
| bool | is_ref () const RYML_NOEXCEPT |
| Forward to Tree::is_ref(). More... | |
| bool | parent_is_seq () const RYML_NOEXCEPT |
| Forward to Tree::parent_is_seq(). More... | |
| bool | parent_is_map () const RYML_NOEXCEPT |
| Forward to Tree::parent_is_map(). More... | |
| bool | is_key_anchor () const noexcept |
| bool | is_val_hanchor () const noexcept |
| bool | is_anchor () const noexcept |
| bool | is_anchor_or_ref () const noexcept |
node container+scalar style predicates | |
| bool | type_has_any (NodeType_e bits) const RYML_NOEXCEPT |
| Forward to Tree::type_has_any(). More... | |
| bool | type_has_all (NodeType_e bits) const RYML_NOEXCEPT |
| Forward to Tree::type_has_all(). More... | |
| bool | type_has_none (NodeType_e bits) const RYML_NOEXCEPT |
| Forward to Tree::type_has_none(). More... | |
| bool | is_container_styled () const RYML_NOEXCEPT |
| Forward to Tree::is_container_styled(). More... | |
| bool | is_block () const RYML_NOEXCEPT |
| Forward to Tree::is_block(). More... | |
| bool | is_flow_sl () const RYML_NOEXCEPT |
| Forward to Tree::is_flow_sl(). More... | |
| bool | is_flow_ml () const RYML_NOEXCEPT |
| Forward to Tree::is_flow_ml(). More... | |
| bool | is_flow () const RYML_NOEXCEPT |
| Forward to Tree::is_flow(). More... | |
| bool | is_key_styled () const RYML_NOEXCEPT |
| Forward to Tree::is_key_styled(). More... | |
| bool | is_val_styled () const RYML_NOEXCEPT |
| Forward to Tree::is_val_styled(). More... | |
| bool | is_key_literal () const RYML_NOEXCEPT |
| Forward to Tree::is_key_literal(). More... | |
| bool | is_val_literal () const RYML_NOEXCEPT |
| Forward to Tree::is_val_literal(). More... | |
| bool | is_key_folded () const RYML_NOEXCEPT |
| Forward to Tree::is_key_folded(). More... | |
| bool | is_val_folded () const RYML_NOEXCEPT |
| Forward to Tree::is_val_folded(). More... | |
| bool | is_key_squo () const RYML_NOEXCEPT |
| Forward to Tree::is_key_squo(). More... | |
| bool | is_val_squo () const RYML_NOEXCEPT |
| Forward to Tree::is_val_squo(). More... | |
| bool | is_key_dquo () const RYML_NOEXCEPT |
| Forward to Tree::is_key_dquo(). More... | |
| bool | is_val_dquo () const RYML_NOEXCEPT |
| Forward to Tree::is_val_dquo(). More... | |
| bool | is_key_plain () const RYML_NOEXCEPT |
| Forward to Tree::is_key_plain(). More... | |
| bool | is_val_plain () const RYML_NOEXCEPT |
| Forward to Tree::is_val_plain(). More... | |
| bool | is_key_quoted () const RYML_NOEXCEPT |
| Forward to Tree::is_key_quoted(). More... | |
| bool | is_val_quoted () const RYML_NOEXCEPT |
| Forward to Tree::is_val_quoted(). More... | |
| bool | is_quoted () const RYML_NOEXCEPT |
| Forward to Tree::is_quoted(). More... | |
hierarchy predicates | |
| bool | is_root () const RYML_NOEXCEPT |
| Forward to Tree::is_root(). More... | |
| bool | has_parent () const RYML_NOEXCEPT |
| Forward to Tree::has_parent() Node must be readable. More... | |
| bool | has_child (ConstNodeRef const &n) const RYML_NOEXCEPT |
| Forward to Tree::has_child(). More... | |
| bool | has_child (id_type node) const RYML_NOEXCEPT |
| Forward to Tree::has_child(). More... | |
| bool | has_child (csubstr name) const RYML_NOEXCEPT |
| Forward to Tree::has_child(). More... | |
| bool | has_children () const RYML_NOEXCEPT |
| Forward to Tree::has_child(). More... | |
| bool | has_sibling (ConstNodeRef const &n) const RYML_NOEXCEPT |
| Forward to Tree::has_sibling(). More... | |
| bool | has_sibling (id_type node) const RYML_NOEXCEPT |
| Forward to Tree::has_sibling(). More... | |
| bool | has_sibling (csubstr name) const RYML_NOEXCEPT |
| Forward to Tree::has_sibling(). More... | |
| bool | has_other_siblings () const RYML_NOEXCEPT |
| Forward to Tree::has_sibling(). More... | |
| bool | has_siblings () const RYML_NOEXCEPT |
hierarchy getters | |
| auto | doc (id_type i) RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::doc(). More... | |
| ConstNodeRef | doc (id_type i) const RYML_NOEXCEPT |
| succeeds even when the node may have invalid or seed id More... | |
| auto | parent () RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::parent(). More... | |
| ConstNodeRef | parent () const RYML_NOEXCEPT |
| Forward to Tree::parent(). More... | |
| auto | first_child () RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::first_child(). More... | |
| ConstNodeRef | first_child () const RYML_NOEXCEPT |
| Forward to Tree::first_child(). More... | |
| auto | last_child () RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::last_child(). More... | |
| ConstNodeRef | last_child () const RYML_NOEXCEPT |
| Forward to Tree::last_child(). More... | |
| auto | child (id_type pos) RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::child(). More... | |
| ConstNodeRef | child (id_type pos) const RYML_NOEXCEPT |
| Forward to Tree::child(). More... | |
| auto | find_child (csubstr name) RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::first_child(). More... | |
| ConstNodeRef | find_child (csubstr name) const RYML_NOEXCEPT |
| Forward to Tree::first_child(). More... | |
| auto | prev_sibling () RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::prev_sibling(). More... | |
| ConstNodeRef | prev_sibling () const RYML_NOEXCEPT |
| Forward to Tree::prev_sibling(). More... | |
| auto | next_sibling () RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::next_sibling(). More... | |
| ConstNodeRef | next_sibling () const RYML_NOEXCEPT |
| Forward to Tree::next_sibling(). More... | |
| auto | first_sibling () RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::first_sibling(). More... | |
| ConstNodeRef | first_sibling () const RYML_NOEXCEPT |
| Forward to Tree::first_sibling(). More... | |
| auto | last_sibling () RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::last_sibling(). More... | |
| ConstNodeRef | last_sibling () const RYML_NOEXCEPT |
| Forward to Tree::last_sibling(). More... | |
| auto | sibling (id_type pos) RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::sibling(). More... | |
| ConstNodeRef | sibling (id_type pos) const RYML_NOEXCEPT |
| Forward to Tree::sibling(). More... | |
| auto | find_sibling (csubstr name) RYML_NOEXCEPT -> NodeRef |
| Forward to Tree::find_sibling(). More... | |
| ConstNodeRef | find_sibling (csubstr name) const RYML_NOEXCEPT |
| Forward to Tree::find_sibling(). More... | |
| id_type | num_children () const RYML_NOEXCEPT |
| O(num_children). More... | |
| id_type | num_siblings () const RYML_NOEXCEPT |
| O(num_children). More... | |
| id_type | num_other_siblings () const RYML_NOEXCEPT |
| O(num_siblings). More... | |
| id_type | child_pos (ConstNodeRef const &n) const RYML_NOEXCEPT |
| O(num_children). More... | |
| id_type | sibling_pos (ConstNodeRef const &n) const RYML_NOEXCEPT |
| O(num_siblings). More... | |
| id_type | depth_asc () const RYML_NOEXCEPT |
| id_type | depth_desc () const RYML_NOEXCEPT |
| O(log(num_nodes)). More... | |
square_brackets | |
| auto | operator[] (csubstr key) RYML_NOEXCEPT -> NodeRef |
| Find child by key; complexity is O(num_children). More... | |
| auto | operator[] (id_type pos) RYML_NOEXCEPT -> NodeRef |
| Find child by position; complexity is O(pos). More... | |
| ConstNodeRef | operator[] (csubstr key) const RYML_NOEXCEPT |
| Find a child by key; complexity is O(num_children). More... | |
| ConstNodeRef | operator[] (id_type pos) const RYML_NOEXCEPT |
| Find a child by position; complexity is O(pos). More... | |
at | |
These functions are the analogue to operator[], with the difference that they emit an error instead of an assertion. That is, if any of the pre or post conditions is violated, an error is always emitted (resulting in a call to the error callback). | |
| auto | at (csubstr key) -> NodeRef |
| Find child by key; complexity is O(num_children). More... | |
| auto | at (id_type pos) -> NodeRef |
| Find child by position; complexity is O(pos). More... | |
| ConstNodeRef | at (csubstr key) const |
| Get a child by name, with error checking; complexity is O(num_children). More... | |
| ConstNodeRef | at (id_type pos) const |
| Get a child by position, with error checking; complexity is O(pos). More... | |
deserialization | |
| ConstNodeRef const & | operator>> (T &v) const |
| deserialize the node's val to the given variable, forwarding to the user-overrideable read() function. More... | |
| ConstNodeRef const & | operator>> (Key< T > v) const |
deserialize the node's key to the given variable, forwarding to the user-overrideable read() function; use key() to disambiguate; for example: node >> ryml::key(var) More... | |
| ConstNodeRef const & | operator>> (Key< fmt::base64_wrapper > w) const |
| deserialize the node's key as base64. More... | |
| ConstNodeRef const & | operator>> (fmt::base64_wrapper w) const |
| deserialize the node's val as base64. More... | |
| size_t | deserialize_key (fmt::base64_wrapper v) const |
| decode the base64-encoded key and assign the decoded blob to the given buffer/ More... | |
| size_t | deserialize_val (fmt::base64_wrapper v) const |
| decode the base64-encoded key and assign the decoded blob to the given buffer/ More... | |
| bool | get_if (csubstr name, T *var) const |
| look for a child by name, if it exists assign to var. More... | |
| bool | get_if (csubstr name, T *var, T const &fallback) const |
| look for a child by name, if it exists assign to var, otherwise default to fallback. More... | |
Friends | |
| struct | detail::RoNodeMethods< NodeRef, ConstNodeRef > |
iteration | |
| using | iterator = detail::child_iterator< NodeRef > |
| using | const_iterator = detail::child_iterator< ConstNodeRef > |
| using | children_view = detail::children_view_< NodeRef > |
| using | const_children_view = detail::children_view_< ConstNodeRef > |
| auto | begin () RYML_NOEXCEPT -> iterator |
| get an iterator to the first child More... | |
| const_iterator | begin () const RYML_NOEXCEPT |
| get an iterator to the first child More... | |
| const_iterator | cbegin () const RYML_NOEXCEPT |
| get an iterator to the first child More... | |
| auto | end () RYML_NOEXCEPT -> iterator |
| get an iterator to after the last child More... | |
| const_iterator | end () const RYML_NOEXCEPT |
| get an iterator to after the last child More... | |
| const_iterator | cend () const RYML_NOEXCEPT |
| get an iterator to after the last child More... | |
| auto | children () RYML_NOEXCEPT -> children_view |
| get an iterable view over children More... | |
| const_children_view | children () const RYML_NOEXCEPT |
| get an iterable view over children More... | |
| const_children_view | cchildren () const RYML_NOEXCEPT |
| get an iterable view over children More... | |
| auto | siblings () RYML_NOEXCEPT -> children_view |
| get an iterable view over all siblings (including the calling node) More... | |
| const_children_view | siblings () const RYML_NOEXCEPT |
| get an iterable view over all siblings (including the calling node) More... | |
| const_children_view | csiblings () const RYML_NOEXCEPT |
| get an iterable view over all siblings (including the calling node) More... | |
| bool | visit (Visitor fn, id_type indentation_level=0, bool skip_root=true) const RYML_NOEXCEPT |
| visit every child node calling fn(node) More... | |
| auto | visit (Visitor fn, id_type indentation_level=0, bool skip_root=true) RYML_NOEXCEPT -> bool |
| visit every child node calling fn(node) More... | |
| bool | visit_stacked (Visitor fn, id_type indentation_level=0, bool skip_root=true) const RYML_NOEXCEPT |
| visit every child node calling fn(node, level) More... | |
| auto | visit_stacked (Visitor fn, id_type indentation_level=0, bool skip_root=true) RYML_NOEXCEPT -> bool |
| visit every child node calling fn(node, level) More... | |
A reference to a node in an existing yaml tree, offering a more convenient API than the index-based API used in the tree.
Unlike its imutable ConstNodeRef peer, a NodeRef can be used to mutate the tree, both by writing to existing nodes and by creating new nodes to subsequently write to. Semantically, a NodeRef object can be in one of three states:
So both readable and seed are states where the node is also valid.
When the object is in seed state, using it to read from the tree is UB. The seed node can be used to write to the tree, provided that its create() method is called prior to writing, which happens in most modifying methods in NodeRef.
It is the owners's responsibility to verify that an existing node is readable before subsequently using it to read from the tree.
| using c4::yml::NodeRef::tree_type = Tree |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlinenoexcept |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlinenoexcept |
Definition at line 1023 of file node.hpp.
References c4::yml::npos.
|
inlinenoexcept |
true if the object is not referring to any existing or seed node.
Definition at line 1046 of file node.hpp.
References c4::yml::NONE.
Referenced by c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::yml::parse_json_in_arena(), c4::yml::parse_json_in_place(), sample::sample_create_trees(), and sample::sample_quick_overview().
|
inlinenoexcept |
true if the object is not invalid and in seed state.
Definition at line 1048 of file node.hpp.
References c4::yml::NONE.
Referenced by operator==(), sample::sample_create_trees(), and sample::sample_quick_overview().
|
inlinenoexcept |
true if the object is not invalid and not in seed state.
Definition at line 1050 of file node.hpp.
References c4::yml::NONE.
Referenced by sample::sample_quick_overview().
|
inline |
|
inline |
Definition at line 1061 of file node.hpp.
References is_seed().
|
inline |
|
inline |
Definition at line 1081 of file node.hpp.
References c4::yml::ConstNodeRef::m_id, and c4::yml::ConstNodeRef::m_tree.
|
inline |
|
inlinenoexcept |
Definition at line 1097 of file node.hpp.
Referenced by c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::yml::parse_json_in_arena(), and c4::yml::parse_json_in_place().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 1100 of file node.hpp.
Referenced by c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::yml::parse_json_in_arena(), c4::yml::parse_json_in_place(), remove_child(), and sample::sample_docs().
|
inline |
|
inline |
Definition at line 1111 of file node.hpp.
References _C4RR.
|
inline |
|
inline |
Definition at line 1114 of file node.hpp.
References c4::yml::key().
Referenced by set_key_serialized().
|
inline |
Definition at line 1115 of file node.hpp.
Referenced by set_val_serialized().
|
inline |
Definition at line 1116 of file node.hpp.
|
inline |
Definition at line 1117 of file node.hpp.
|
inline |
Definition at line 1118 of file node.hpp.
|
inline |
Definition at line 1119 of file node.hpp.
|
inline |
Definition at line 1120 of file node.hpp.
|
inline |
Definition at line 1121 of file node.hpp.
|
inline |
Definition at line 1123 of file node.hpp.
References _C4RR.
|
inline |
Definition at line 1124 of file node.hpp.
References _C4RR.
|
inline |
Definition at line 1125 of file node.hpp.
References _C4RR.
|
inline |
Definition at line 1129 of file node.hpp.
Referenced by remove_child().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
serialize a variable to the arena
Definition at line 1212 of file node.hpp.
Referenced by set_key_serialized(), and set_val_serialized().
|
inline |
|
inline |
|
inline |
Definition at line 1234 of file node.hpp.
Referenced by sample::sample_tree_arena(), and c4::yml::write().
|
inline |
| size_t c4::yml::NodeRef::set_key_serialized | ( | fmt::const_base64_wrapper | w | ) |
encode a blob as base64 into the tree's arena, then assign the result to the node's key
Definition at line 13 of file node.cpp.
References set_key(), and to_arena().
| size_t c4::yml::NodeRef::set_val_serialized | ( | fmt::const_base64_wrapper | w | ) |
encode a blob as base64 into the tree's arena, then assign the result to the node's val
Definition at line 21 of file node.cpp.
References set_val(), and to_arena().
|
inline |
serialize a variable, then assign the result to the node's val
Definition at line 1258 of file node.hpp.
References c4::yml::write().
|
inline |
Definition at line 1269 of file node.hpp.
References c4::yml::write().
serialize a variable, then assign the result to the node's key
Definition at line 1278 of file node.hpp.
References c4::yml::Key< K >::k.
serialize a variable, then assign the result to the node's key
Definition at line 1287 of file node.hpp.
References c4::yml::Key< K >::k.
|
inline |
Definition at line 1294 of file node.hpp.
References c4::yml::Key< fmt::const_base64_wrapper >::wrapper.
|
inline |
Definition at line 1353 of file node.hpp.
References _C4RR.
|
inline |
|
inline |
Definition at line 1385 of file node.hpp.
References _C4RR.
Referenced by sample::sample_base64(), sample::sample_create_trees(), sample::sample_float_precision(), sample::sample_lightning_overview(), sample::sample_parse_reuse_tree(), sample::sample_quick_overview(), c4::yml::write(), and sample::write().
|
inline |
Definition at line 1400 of file node.hpp.
References _C4RR, c4::yml::ConstNodeRef::m_id, and c4::yml::ConstNodeRef::m_tree.
|
inline |
Definition at line 1408 of file node.hpp.
References _C4RR, c4::yml::ConstNodeRef::m_id, and c4::yml::ConstNodeRef::m_tree.
|
inline |
Definition at line 1417 of file node.hpp.
References _C4RR.
|
inline |
|
inline |
Definition at line 1449 of file node.hpp.
References _C4RR, clear(), id(), and c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::parent().
|
inline |
remove the nth child of this node
Definition at line 1459 of file node.hpp.
References _C4RR, and c4::yml::NONE.
|
inline |
remove a child by name
Definition at line 1469 of file node.hpp.
References _C4RR, c4::yml::key(), and c4::yml::NONE.
|
inline |
change the node's position within its parent, placing it after after.
To move to the first position in the parent, simply pass an empty or default-constructed reference like this: n.move({}).
Definition at line 1483 of file node.hpp.
References _C4RR, and c4::yml::ConstNodeRef::m_id.
|
inline |
move the node to a different parent (which may belong to a different tree), placing it after after.
When the destination parent is in a new tree, then this node's tree pointer is reset to the tree of the parent node.
Definition at line 1493 of file node.hpp.
References _C4RR, c4::yml::ConstNodeRef::m_id, and c4::yml::Tree::move().
|
inline |
duplicate the current node somewhere within its parent, and place it after the node after.
To place into the first position of the parent, simply pass an empty or default-constructed reference like this: n.move({}).
Definition at line 1511 of file node.hpp.
References _C4RR, c4::yml::ConstNodeRef::m_id, c4::yml::ConstNodeRef::m_tree, and c4::yml::NONE.
|
inline |
duplicate the current node somewhere into a different parent (possibly from a different tree), and place it after the node after.
To place into the first position of the parent, simply pass an empty or default-constructed reference like this: n.move({}).
Definition at line 1525 of file node.hpp.
References _C4RR, c4::yml::Tree::duplicate(), c4::yml::ConstNodeRef::m_id, c4::yml::ConstNodeRef::m_tree, and c4::yml::NONE.
|
inline |
Definition at line 1543 of file node.hpp.
References _C4RR, c4::yml::Tree::duplicate_children(), c4::yml::ConstNodeRef::m_id, and c4::yml::ConstNodeRef::m_tree.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinenoexceptinherited |
Forward to Tree::is_key_unfiltered().
Node must be readable.
|
inlinenoexceptinherited |
Forward to Tree::is_val_unfiltered().
Node must be readable.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlinenoexceptinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Forward to Tree::is_container_styled().
Node must be readable.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Forward to Tree::has_parent() Node must be readable.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
succeeds even when the node may have invalid or seed id
Forward to Tree::doc(). Node must be readable.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
O(log(num_nodes)).
Forward to Tree::depth_asc(). Node must be readable.
Definition at line 385 of file node.hpp.
|
inlineinherited |
Find child by key; complexity is O(num_children).
Returns the requested node, or an object in seed state if no such child is found (see NodeRef for an explanation of what is seed state). When the object is in seed state, using it to read from the tree is UB. The seed node can be used to write to the tree provided that its create() method is called prior to writing, which happens in most modifying methods in NodeRef. It is the caller's responsibility to verify that the returned node is readable before subsequently using it to read from the tree.
|
inlineinherited |
Find child by position; complexity is O(pos).
Returns the requested node, or an object in seed state if no such child is found (see NodeRef for an explanation of what is seed state). When the object is in seed state, using it to read from the tree is UB. The seed node can be used to write to the tree provided that its create() method is called prior to writing, which happens in most modifying methods in NodeRef. It is the caller's responsibility to verify that the returned node is readable before subsequently using it to read from the tree.
|
inlineinherited |
Find a child by key; complexity is O(num_children).
Behaves similar to the non-const overload, but further asserts that the returned node is readable (because it can never be in a seed state). The assertion is performed only if RYML_USE_ASSERT is set to true. As with the non-const overload, it is UB to use the return value if it is not valid.
|
inlineinherited |
Find a child by position; complexity is O(pos).
Behaves similar to the non-const overload, but further asserts that the returned node is readable (because it can never be in a seed state). This assertion is performed only if RYML_USE_ASSERT is set to true. As with the non-const overload, it is UB to use the return value if it is not valid.
|
inlineinherited |
Find child by key; complexity is O(num_children).
Returns the requested node, or an object in seed state if no such child is found (see NodeRef for an explanation of what is seed state). When the object is in seed state, using it to read from the tree is UB. The seed node can be subsequently used to write to the tree provided that its create() method is called prior to writing, which happens inside most mutating methods in NodeRef. It is the caller's responsibility to verify that the returned node is readable before subsequently using it to read from the tree.
Definition at line 521 of file node.hpp.
|
inlineinherited |
Find child by position; complexity is O(pos).
Returns the requested node, or an object in seed state if no such child is found (see NodeRef for an explanation of what is seed state). When the object is in seed state, using it to read from the tree is UB. The seed node can be used to write to the tree provided that its create() method is called prior to writing, which happens in most modifying methods in NodeRef. It is the caller's responsibility to verify that the returned node is readable before subsequently using it to read from the tree.
Definition at line 557 of file node.hpp.
|
inlineinherited |
Get a child by name, with error checking; complexity is O(num_children).
Behaves as operator[](csubstr) const, but always raises an error (even when RYML_USE_ASSERT is set to false) when the returned node does not exist, or when this node is not readable, or when it is not a map. This behaviour is similar to std::vector::at(), but the error consists in calling the error callback instead of directly raising an exception.
Definition at line 578 of file node.hpp.
|
inlineinherited |
Get a child by position, with error checking; complexity is O(pos).
Behaves as operator[](id_type) const, but always raises an error (even when RYML_USE_ASSERT is set to false) when the returned node does not exist, or when this node is not readable, or when it is not a container. This behaviour is similar to std::vector::at(), but the error consists in calling the error callback instead of directly raising an exception.
Definition at line 598 of file node.hpp.
|
inlineinherited |
deserialize the node's val to the given variable, forwarding to the user-overrideable read() function.
Definition at line 621 of file node.hpp.
|
inlineinherited |
deserialize the node's key to the given variable, forwarding to the user-overrideable read() function; use key() to disambiguate; for example: node >> ryml::key(var)
Definition at line 633 of file node.hpp.
|
inlineinherited |
deserialize the node's key as base64.
lightweight wrapper over deserialize_key()
Definition at line 642 of file node.hpp.
|
inlineinherited |
deserialize the node's val as base64.
lightweight wrapper over deserialize_val()
Definition at line 649 of file node.hpp.
|
inlineinherited |
decode the base64-encoded key and assign the decoded blob to the given buffer/
|
inlineinherited |
decode the base64-encoded key and assign the decoded blob to the given buffer/
|
inlineinherited |
look for a child by name, if it exists assign to var.
return true if the child existed.
Definition at line 675 of file node.hpp.
|
inlineinherited |
|
inlineinherited |
get an iterator to the first child
Definition at line 729 of file node.hpp.
|
inlineinherited |
get an iterator to the first child
Definition at line 731 of file node.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
get an iterable view over children
Definition at line 745 of file node.hpp.
|
inlineinherited |
get an iterable view over children
Definition at line 747 of file node.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
get an iterable view over all siblings (including the calling node)
Definition at line 763 of file node.hpp.
|
inlineinherited |
get an iterable view over all siblings (including the calling node)
Definition at line 773 of file node.hpp.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
friend |