rapidyaml  0.16.0
parseandemitYAML,anddoitfast
c4::yml::NodeRef Class Reference

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>

Inheritance diagram for c4::yml::NodeRef:
c4::yml::detail::RoNodeMethods< NodeRef, ConstNodeRef >

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
 
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...
 
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
id_type id () const noexcept
 
Tree const * tree () const noexcept
 
Tree * tree () noexcept
 
NodeData const * get () const RYML_NOEXCEPT
 Forward to Tree::type(). More...
 
NodeData * get () RYML_NOEXCEPT
 Forward to Tree::type(). More...
 
node_setters
void create ()
 if this node is in seed state, create the node in the tree More...
 
void set_stream ()
 
void set_doc ()
 
void set_key (csubstr key)
 
void set_key (csubstr key, NodeType more_flags)
 
void set_val (csubstr val)
 
void set_val (csubstr val, NodeType more_flags)
 
void set_seq ()
 
void set_seq (NodeType more_flags)
 
void set_map ()
 
void set_map (NodeType more_flags)
 
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 (type_bits style)
 
void set_key_style (type_bits style)
 
void set_val_style (type_bits style)
 
node_modifiers
void change_type (NodeType t)
 
void clear_key ()
 remove the KEY (flags included) from a scalar More...
 
void clear_val ()
 remove the VAL (flags included) from a scalar More...
 
void clear_children ()
 remove the children from a scalar More...
 
void clear_style (bool recurse=false)
 
void set_style_conditionally (NodeType type_mask, NodeType rem_style_flags, NodeType add_style_flags, bool recurse=false)
 
serialization
template<class T >
csubstr to_arena (T const &s)
 forward to Tree::to_arena() . More...
 
template<class T >
void save (T const &k)
 
template<class T >
void save (T const &k, NodeType style_flags)
 
template<class T >
void save_key (T const &k)
 
template<class T >
void save_key (T const &k, NodeType style_flags)
 
template<class T >
void set_serialized (T const &v)
 serialize a variable to this node. More...
 
template<class T >
void set_serialized (T const &v, NodeType style_flags)
 
template<class T >
void set_key_serialized (T const &k)
 serialize a variable, then assign the result to the node's key More...
 
template<class T >
void set_key_serialized (T const &k, NodeType style_flags)
 
hierarchy getters
NodeRef parent () RYML_NOEXCEPT
 Forward to Tree::parent(). More...
 
ConstNodeRef parent () const RYML_NOEXCEPT
 Forward to Tree::parent(). More...
 
NodeRef first_child () RYML_NOEXCEPT
 Forward to Tree::first_child(). More...
 
ConstNodeRef first_child () const RYML_NOEXCEPT
 Forward to Tree::first_child(). More...
 
NodeRef last_child () RYML_NOEXCEPT
 Forward to Tree::last_child(). More...
 
ConstNodeRef last_child () const RYML_NOEXCEPT
 Forward to Tree::last_child(). More...
 
NodeRef child (id_type pos) RYML_NOEXCEPT
 Forward to Tree::child(). More...
 
ConstNodeRef child (id_type pos) const RYML_NOEXCEPT
 Forward to Tree::child(). More...
 
ReadResult child_r (id_type pos, NodeRef *child) RYML_NOEXCEPT
 
ReadResult child_r (id_type pos, ConstNodeRef *child) const RYML_NOEXCEPT
 Forward to Tree::child_r(). More...
 
NodeRef find_child (csubstr name) RYML_NOEXCEPT
 Forward to Tree::child_r(). More...
 
ConstNodeRef find_child (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::find_child(). More...
 
ReadResult find_child_r (csubstr name, NodeRef *child) RYML_NOEXCEPT
 
ReadResult find_child_r (csubstr name, ConstNodeRef *child) const RYML_NOEXCEPT
 Forward to Tree::find_child_r(). More...
 
NodeRef prev_sibling () RYML_NOEXCEPT
 Forward to Tree::find_child_r(). More...
 
ConstNodeRef prev_sibling () const RYML_NOEXCEPT
 Forward to Tree::prev_sibling(). More...
 
NodeRef next_sibling () RYML_NOEXCEPT
 Forward to Tree::next_sibling(). More...
 
ConstNodeRef next_sibling () const RYML_NOEXCEPT
 Forward to Tree::next_sibling(). More...
 
NodeRef first_sibling () RYML_NOEXCEPT
 Forward to Tree::first_sibling(). More...
 
ConstNodeRef first_sibling () const RYML_NOEXCEPT
 Forward to Tree::first_sibling(). More...
 
NodeRef last_sibling () RYML_NOEXCEPT
 Forward to Tree::last_sibling(). More...
 
ConstNodeRef last_sibling () const RYML_NOEXCEPT
 Forward to Tree::last_sibling(). More...
 
NodeRef sibling (id_type pos) RYML_NOEXCEPT
 Forward to Tree::sibling(). More...
 
ConstNodeRef sibling (id_type pos) const RYML_NOEXCEPT
 Forward to Tree::sibling(). More...
 
ReadResult sibling_r (id_type pos, NodeRef *sibling) RYML_NOEXCEPT
 
ReadResult sibling_r (id_type pos, ConstNodeRef *sibling) const RYML_NOEXCEPT
 Forward to Tree::sibling_r(). More...
 
NodeRef find_sibling (csubstr name) RYML_NOEXCEPT
 Forward to Tree::sibling_r(). More...
 
ConstNodeRef find_sibling (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::find_sibling(). More...
 
ReadResult find_sibling_r (csubstr name, NodeRef *sibling) RYML_NOEXCEPT
 
ReadResult find_sibling_r (csubstr name, ConstNodeRef *sibling) const RYML_NOEXCEPT
 Forward to Tree::find_sibling_r(). More...
 
NodeRef ancestor_doc () RYML_NOEXCEPT
 Forward to Tree::find_sibling_r(). More...
 
ConstNodeRef ancestor_doc () const RYML_NOEXCEPT
 Forward to Tree::ancestor_doc(). More...
 
NodeRef doc (id_type i) RYML_NOEXCEPT
 Forward to Tree::doc(). More...
 
ConstNodeRef doc (id_type i) const RYML_NOEXCEPT
 Forward to Tree::doc(). More...
 
square_brackets

operator[]

NodeRef operator[] (csubstr key) RYML_NOEXCEPT
 Find child by key; complexity is O(num_children). More...
 
NodeRef operator[] (id_type pos) RYML_NOEXCEPT
 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).

NodeRef at (csubstr key)
 Find child by key; complexity is O(num_children). More...
 
NodeRef at (id_type pos)
 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...
 
modification of hierarchy
NodeRef insert_child (NodeRef after)
 
NodeRef prepend_child ()
 
NodeRef append_child ()
 
NodeRef insert_sibling (ConstNodeRef const &after)
 
NodeRef prepend_sibling ()
 
NodeRef append_sibling ()
 
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 (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 (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...
 
NodeRef duplicate_children (NodeRef const &parent, ConstNodeRef const &after) const
 
legacy operators

get an iterable view over all siblings (including the calling node)

these methods will be removed in future releases. If you disagree with a particular function being deprecated, let us know by opening a new issue at https://github.com/biojppm/rapidyaml/issues

void operator= (type_bits t)
 
void operator|= (type_bits t)
 
NodeRef & operator= (csubstr v)
 
template<size_t N>
NodeRef & operator= (const char(&v)[N])
 
NodeRef & operator= (std::nullptr_t)
 
template<class T >
NodeRef & operator= (Key< T > const &v)
 
template<class T >
NodeRef & operator<< (T const &v)
 
NodeRef & operator<< (csubstr v)
 
template<class T >
NodeRef & operator<< (Key< T > const &v)
 
node property getters
NodeType type () const RYML_NOEXCEPT
 Forward to Tree::type(). 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...
 
style predicates
bool type_has_any (type_bits bits) const RYML_NOEXCEPT
 Forward to Tree::type_has_any(). More...
 
bool type_has_all (type_bits bits) const RYML_NOEXCEPT
 Forward to Tree::type_has_all(). More...
 
bool type_has_none (type_bits bits) const RYML_NOEXCEPT
 Forward to Tree::type_has_none(). More...
 
NodeType key_style () const RYML_NOEXCEPT
 Forward to Tree::key_style(). More...
 
NodeType val_style () const RYML_NOEXCEPT
 Forward to Tree::val_style(). 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 () const RYML_NOEXCEPT
 Forward to Tree::is_flow(). 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_ml1(). More...
 
bool is_flow_ml1 () const RYML_NOEXCEPT
 Forward to Tree::is_flow_ml1(). More...
 
bool is_flow_mln () const RYML_NOEXCEPT
 Forward to Tree::is_flow_mln(). More...
 
bool is_flow_mlx () const RYML_NOEXCEPT
 Forward to Tree::is_flow_mlx(). More...
 
bool has_flow_space () const RYML_NOEXCEPT
 Forward to Tree::has_flow_space(). 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 is_ancestor (ConstNodeRef const &ancestor) const RYML_NOEXCEPT
 Forward to Tree::is_ancestor() 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_children(). 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_other_siblings(). More...
 
hierarchy getters
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...
 
locations

O(num_nodes).

Forward to Tree::depth_desc(). Node must be readable.

Location location (Parser const &parser) const
 
deserialization: fully checked for lazy code

These methods raise an error if the deserialization failed or optionally if the node is not readable.

void load (T *v, bool check_readable=true) const
 (1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-overrideable read() function, which can be for ConstNodeRef (see Read from ConstNodeRef) or for tree+id (see Read from Tree). More...
 
void load (Wrapper const &wrapper, bool check_readable=true) const
 (2) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
void load_key (T *k, bool check_readable=true) const
 (1) deserialize the node's key (necessarily a scalar) to the given variable, forwarding to the user-overrideable read_key() function, which can be for ConstNodeRef (see Read from ConstNodeRef) or for tree+id (see Read from Tree). More...
 
void load_key (Wrapper const &wrapper, bool check_readable=true) const
 (2) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
deserialization: asserts node readability, returns success status
ReadResult deserialize (T *v) const
 (1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-overrideable read() function (see Read from ConstNodeRef). More...
 
ReadResult deserialize (Wrapper const &wrapper) const
 (2) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
ReadResult deserialize_key (T *v) const
 (1) deserialize the node's key (necessarily a scalar) to the given variable, forwarding to the user-overrideable read_key() function (see Read from ConstNodeRef). More...
 
ReadResult deserialize_key (Wrapper const &wrapper) const
 (2) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
lookup and deserialize
ReadResult deserialize_child (csubstr child_key, T *v) const
 (1) find a child by name and deserialize its contents to the given variable (ie call .deserialize() on the child if it exists). More...
 
ReadResult deserialize_child (csubstr child_key, T *v, T const &fallback) const
 (2) like (1), but assign from fallback if no such child exists. More...
 
ReadResult deserialize_child (csubstr child_key, Wrapper const &v) const
 (3) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
ReadResult deserialize_child (id_type child_pos, T *v) const
 (1) find a child by position and deserialize its contents to the given variable (ie call .deserialize() on the child if it exists). More...
 
ReadResult deserialize_child (id_type child_pos, T *v, T const &fallback) const
 (2) like (1), but assign from fallback if no such child exists More...
 
ReadResult deserialize_child (id_type child_pos, Wrapper const &wrapper) const
 (3) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
legacy operators
NodeRef const & operator>> (T &v) const
 
NodeRef const & operator>> (T const &wrapper) const
 
NodeRef const & operator>> (Key< T > const &v) const
 

Protected Member Functions

void check_val_ () const
 
void check_key_ () const
 
void assert_val_ () const noexcept
 
void assert_key_ () const noexcept
 

Static Protected Member Functions

static void err_basic_ (const char *msg)
 
static void err_visit_ (Tree const *tree, id_type id, const char *msg)
 

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 >
 
iterator begin () RYML_NOEXCEPT
 get a mutable 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...
 
iterator end () RYML_NOEXCEPT
 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...
 
children_view children () RYML_NOEXCEPT
 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...
 
children_view siblings () RYML_NOEXCEPT
 
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...
 

Detailed Description

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:

  • ```text invalid := not pointing at anything readable := points at an existing tree/node seed := points at an existing tree, and the node may come to exist, if we write to it.
  • ```

    So both readable and seed are states where the node is also valid.

  • ```cpp Tree t = parse_in_arena("{a: b}"); NodeRef invalid; // not pointing at anything. NodeRef readable = t["a"]; // also valid, because "a" exists NodeRef seed = t["none"]; // also valid, but is seed because "none" is not in the map
  • ```

    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.

    Warning
    The lifetime of the tree must be larger than that of this object. It is up to the user to ensure that this happens.

Definition at line 1062 of file node.hpp.

Member Typedef Documentation

Definition at line 1066 of file node.hpp.

using c4::yml::NodeRef::iterator = detail::child_iterator<NodeRef>

Definition at line 1828 of file node.hpp.

using c4::yml::NodeRef::const_iterator = detail::child_iterator<ConstNodeRef>

Definition at line 1829 of file node.hpp.

using c4::yml::NodeRef::children_view = detail::children_view<NodeRef>

Definition at line 1830 of file node.hpp.

using c4::yml::NodeRef::const_children_view = detail::children_view<ConstNodeRef>

Definition at line 1831 of file node.hpp.

Constructor & Destructor Documentation

c4::yml::NodeRef::NodeRef ( )
inlinenoexcept

Definition at line 1106 of file node.hpp.

1106 : m_tree(nullptr), m_id(NONE), m_seed() { _clear_seed(); }
an index to none
Definition: common.hpp:131
c4::yml::NodeRef::NodeRef ( Tree &  t)
inlinenoexcept

Definition at line 1107 of file node.hpp.

1107 : m_tree(&t), m_id(t .root_id()), m_seed() { _clear_seed(); }
c4::yml::NodeRef::NodeRef ( Tree *  t)
inlinenoexcept

Definition at line 1108 of file node.hpp.

1108 : m_tree(t ), m_id(t->root_id()), m_seed() { _clear_seed(); }
c4::yml::NodeRef::NodeRef ( Tree *  t,
id_type  id 
)
inlinenoexcept

Definition at line 1109 of file node.hpp.

1109 : m_tree(t), m_id(id), m_seed() { _clear_seed(); }
c4::yml::NodeRef::NodeRef ( Tree *  t,
id_type  id,
id_type  seed_pos 
)
inlinenoexcept

Definition at line 1110 of file node.hpp.

1110 : m_tree(t), m_id(id), m_seed() { m_seed.str = nullptr; m_seed.len = (size_t)seed_pos; }
C * str
a restricted pointer to the first character of the substring
Definition: substr.hpp:216
size_t len
the length of the substring
Definition: substr.hpp:218
c4::yml::NodeRef::NodeRef ( Tree *  t,
id_type  id,
csubstr  seed_key 
)
inlinenoexcept

Definition at line 1111 of file node.hpp.

1111 : m_tree(t), m_id(id), m_seed(seed_key) {}
c4::yml::NodeRef::NodeRef ( NodeRef const &  )
defaultnoexcept
c4::yml::NodeRef::NodeRef ( NodeRef &&  )
defaultnoexcept

Member Function Documentation

NodeRef& c4::yml::NodeRef::operator= ( NodeRef const &  )
defaultnoexcept
NodeRef& c4::yml::NodeRef::operator= ( NodeRef &&  )
defaultnoexcept
bool c4::yml::NodeRef::invalid ( ) const
inlinenoexcept

true if the object is not referring to any existing or seed node.

See also
the doc for NodeRef

Definition at line 1134 of file node.hpp.

Referenced by sample_create_tree().

1134 { return m_tree == nullptr || m_id == NONE; }
an index to none
Definition: common.hpp:131
bool c4::yml::NodeRef::is_seed ( ) const
inlinenoexcept

true if the object is not invalid and in seed state.

See also
the doc for NodeRef

Definition at line 1136 of file node.hpp.

Referenced by operator==(), and sample_create_tree().

1136 { return (m_tree != nullptr && m_id != NONE) && has_seed_(); }
an index to none
Definition: common.hpp:131
bool c4::yml::NodeRef::readable ( ) const
inlinenoexcept

true if the object is not invalid and not in seed state.

See also
the doc for NodeRef

Definition at line 1138 of file node.hpp.

1138 { return (m_tree != nullptr && m_id != NONE) && !has_seed_(); }
an index to none
Definition: common.hpp:131
bool c4::yml::NodeRef::operator== ( NodeRef const &  that) const
inline

Definition at line 1178 of file node.hpp.

1179  {
1180  if(m_tree == that.m_tree && m_id == that.m_id)
1181  {
1182  bool seed = is_seed();
1183  if(seed == that.is_seed())
1184  {
1185  if(seed)
1186  {
1187  return (m_seed.len == that.m_seed.len)
1188  && (m_seed.str == that.m_seed.str
1189  || m_seed == that.m_seed); // do strcmp only in the last resort
1190  }
1191  return true;
1192  }
1193  }
1194  return false;
1195  }
bool is_seed() const noexcept
true if the object is not invalid and in seed state.
Definition: node.hpp:1136
C * str
a restricted pointer to the first character of the substring
Definition: substr.hpp:216
size_t len
the length of the substring
Definition: substr.hpp:218
bool c4::yml::NodeRef::operator!= ( NodeRef const &  that) const
inline

Definition at line 1196 of file node.hpp.

1196 { return ! this->operator==(that); }
bool operator==(NodeRef const &that) const
Definition: node.hpp:1178
bool c4::yml::NodeRef::operator== ( ConstNodeRef const &  that) const
inline

Definition at line 1198 of file node.hpp.

1198 { return m_tree == that.m_tree && m_id == that.m_id && !is_seed(); }
bool is_seed() const noexcept
true if the object is not invalid and in seed state.
Definition: node.hpp:1136
bool c4::yml::NodeRef::operator!= ( ConstNodeRef const &  that) const
inline

Definition at line 1199 of file node.hpp.

1199 { return ! this->operator==(that); }
bool operator==(NodeRef const &that) const
Definition: node.hpp:1178
id_type c4::yml::NodeRef::id ( ) const
inlinenoexcept
Tree const* c4::yml::NodeRef::tree ( ) const
inlinenoexcept
Tree* c4::yml::NodeRef::tree ( )
inlinenoexcept

Definition at line 1211 of file node.hpp.

1211 { return m_tree; }
NodeData const* c4::yml::NodeRef::get ( ) const
inline

Forward to Tree::type().

Node must be readable.

Definition at line 1213 of file node.hpp.

NodeData* c4::yml::NodeRef::get ( )
inline

Forward to Tree::type().

Node must be readable.

Definition at line 1214 of file node.hpp.

void c4::yml::NodeRef::create ( )
inline

if this node is in seed state, create the node in the tree

Definition at line 1225 of file node.hpp.

1226  {
1227  RYML_ASSERT_BASIC_(m_tree != nullptr);
1228  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, m_id != NONE && m_id < m_tree->capacity(), m_tree, m_id);
1229  if(m_seed.str) // we have a seed key: use it to create the new map child
1230  {
1231  m_id = m_tree->append_child(m_id);
1232  m_tree->set_key(m_id, m_seed);
1233  m_seed.str = nullptr;
1234  m_seed.len = (size_t)NONE;
1235  }
1236  else if(m_seed.len != (size_t)NONE) // we have a seed index: create a seq child at that position
1237  {
1238  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, (size_t)m_tree->num_children(m_id) == m_seed.len, m_tree, m_id);
1239  m_id = m_tree->append_child(m_id);
1240  m_seed.str = nullptr;
1241  m_seed.len = (size_t)NONE;
1242  }
1243  }
an index to none
Definition: common.hpp:131
C * str
a restricted pointer to the first character of the substring
Definition: substr.hpp:216
id_type append_child(id_type parent)
create and insert a node as the last child of parent
Definition: tree.hpp:1180
id_type num_children(id_type node) const
O(num_children)
Definition: tree.cpp:1216
size_t len
the length of the substring
Definition: substr.hpp:218
Callbacks m_callbacks
Definition: tree.hpp:1686
void set_key(id_type node, csubstr key) RYML_NOEXCEPT
Definition: tree.hpp:705
void c4::yml::NodeRef::set_stream ( )
inline

Definition at line 1245 of file node.hpp.

1245 { create(); m_tree->set_stream(m_id); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_stream(id_type node)
Definition: tree.hpp:675
void c4::yml::NodeRef::set_doc ( )
inline

Definition at line 1246 of file node.hpp.

1246 { create(); m_tree->set_doc(m_id); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_doc(id_type node)
Definition: tree.hpp:682
void c4::yml::NodeRef::set_key ( csubstr  key)
inline

Definition at line 1248 of file node.hpp.

1248 { create(); m_tree->set_key(m_id, key); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_key(id_type node, csubstr key) RYML_NOEXCEPT
Definition: tree.hpp:705
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
void c4::yml::NodeRef::set_key ( csubstr  key,
NodeType  more_flags 
)
inline

Definition at line 1249 of file node.hpp.

1249 { create(); m_tree->set_key(m_id, key, more_flags); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_key(id_type node, csubstr key) RYML_NOEXCEPT
Definition: tree.hpp:705
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
void c4::yml::NodeRef::set_val ( csubstr  val)
inline

Definition at line 1251 of file node.hpp.

Referenced by sample_create_tree(), sample_create_tree_style(), and sample_quick_overview().

1251 { create(); m_tree->set_val(m_id, val); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_val(id_type node, csubstr val) RYML_NOEXCEPT
Definition: tree.hpp:688
csubstr val() const RYML_NOEXCEPT
Forward to Tree::val().
Definition: node.hpp:179
void c4::yml::NodeRef::set_val ( csubstr  val,
NodeType  more_flags 
)
inline

Definition at line 1252 of file node.hpp.

1252 { create(); m_tree->set_val(m_id, val, more_flags); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_val(id_type node, csubstr val) RYML_NOEXCEPT
Definition: tree.hpp:688
csubstr val() const RYML_NOEXCEPT
Forward to Tree::val().
Definition: node.hpp:179
void c4::yml::NodeRef::set_seq ( )
inline

Definition at line 1254 of file node.hpp.

Referenced by sample_anchors_and_aliases_create(), sample_create_tree(), sample_create_tree_style(), sample_float_precision(), sample_parse_reuse_tree(), sample_quick_overview(), c4::yml::write(), and write().

1254 { create(); m_tree->set_seq(m_id); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_seq(id_type node) RYML_NOEXCEPT
Definition: tree.hpp:720
void c4::yml::NodeRef::set_seq ( NodeType  more_flags)
inline

Definition at line 1255 of file node.hpp.

1255 { create(); m_tree->set_seq(m_id, more_flags); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_seq(id_type node) RYML_NOEXCEPT
Definition: tree.hpp:720
void c4::yml::NodeRef::set_map ( )
inline

Definition at line 1257 of file node.hpp.

Referenced by sample_anchors_and_aliases_create(), sample_base64(), sample_create_tree(), sample_create_tree_style(), sample_empty_null_values(), sample_parse_reuse_tree(), sample_quick_overview(), sample_user_scalar_types(), c4::yml::write(), and write().

1257 { create(); m_tree->set_map(m_id); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_map(id_type node) RYML_NOEXCEPT
Definition: tree.hpp:731
void c4::yml::NodeRef::set_map ( NodeType  more_flags)
inline

Definition at line 1258 of file node.hpp.

1258 { create(); m_tree->set_map(m_id, more_flags); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_map(id_type node) RYML_NOEXCEPT
Definition: tree.hpp:731
void c4::yml::NodeRef::set_key_tag ( csubstr  key_tag)
inline

Definition at line 1260 of file node.hpp.

1260 { create(); m_tree->set_key_tag(m_id, key_tag); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
csubstr key_tag() const RYML_NOEXCEPT
Forward to Tree::key_tag().
Definition: node.hpp:175
void set_key_tag(id_type node, csubstr tag)
Definition: tree.hpp:742
void c4::yml::NodeRef::set_val_tag ( csubstr  val_tag)
inline

Definition at line 1261 of file node.hpp.

1261 { create(); m_tree->set_val_tag(m_id, val_tag); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
csubstr val_tag() const RYML_NOEXCEPT
Forward to Tree::val_tag().
Definition: node.hpp:180
void set_val_tag(id_type node, csubstr tag)
Definition: tree.hpp:743
void c4::yml::NodeRef::set_key_anchor ( csubstr  key_anchor)
inline

Definition at line 1262 of file node.hpp.

1262 { create(); m_tree->set_key_anchor(m_id, key_anchor); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
csubstr key_anchor() const RYML_NOEXCEPT
Forward to Tree::key_anchor().
Definition: node.hpp:177
void set_key_anchor(id_type node, csubstr anchor)
Definition: tree.hpp:745
void c4::yml::NodeRef::set_val_anchor ( csubstr  val_anchor)
inline

Definition at line 1263 of file node.hpp.

1263 { create(); m_tree->set_val_anchor(m_id, val_anchor); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_val_anchor(id_type node, csubstr anchor)
Definition: tree.hpp:746
csubstr val_anchor() const RYML_NOEXCEPT
Forward to Tree::val_anchor().
Definition: node.hpp:182
void c4::yml::NodeRef::set_key_ref ( csubstr  key_ref)
inline

Definition at line 1264 of file node.hpp.

1264 { create(); m_tree->set_key_ref(m_id, key_ref); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
csubstr key_ref() const RYML_NOEXCEPT
Forward to Tree::key_ref().
Definition: node.hpp:176
void set_key_ref(id_type node, csubstr ref)
Definition: tree.hpp:747
void c4::yml::NodeRef::set_val_ref ( csubstr  val_ref)
inline

Definition at line 1265 of file node.hpp.

Referenced by sample_anchors_and_aliases_create().

1265 { create(); m_tree->set_val_ref(m_id, val_ref); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_val_ref(id_type node, csubstr ref)
Definition: tree.hpp:748
csubstr val_ref() const RYML_NOEXCEPT
Forward to Tree::val_ref().
Definition: node.hpp:181
void c4::yml::NodeRef::set_container_style ( type_bits  style)
inline

Definition at line 1267 of file node.hpp.

Referenced by sample_style(), and sample_style_flow_ml_indent().

1267 { create(); m_tree->set_container_style(m_id, style); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_container_style(id_type node, type_bits style)
Definition: tree.hpp:658
void c4::yml::NodeRef::set_key_style ( type_bits  style)
inline

Definition at line 1268 of file node.hpp.

Referenced by sample_style().

1268 { create(); m_tree->set_key_style(m_id, style); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_key_style(id_type node, type_bits style)
Definition: tree.hpp:659
void c4::yml::NodeRef::set_val_style ( type_bits  style)
inline

Definition at line 1269 of file node.hpp.

Referenced by sample_style().

1269 { create(); m_tree->set_val_style(m_id, style); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void set_val_style(id_type node, type_bits style)
Definition: tree.hpp:660
void c4::yml::NodeRef::change_type ( NodeType  t)
inline

Definition at line 1278 of file node.hpp.

1279  {
1280  assert_readable_();
1281  m_tree->change_type(m_id, t);
1282  }
bool change_type(id_type node, NodeType type)
Definition: tree.cpp:940
void c4::yml::NodeRef::clear_key ( )
inline

remove the KEY (flags included) from a scalar

Definition at line 1285 of file node.hpp.

1286  {
1287  assert_readable_();
1288  m_tree->_clear_key(m_id);
1289  }
void c4::yml::NodeRef::clear_val ( )
inline

remove the VAL (flags included) from a scalar

Definition at line 1292 of file node.hpp.

1293  {
1294  assert_readable_();
1295  m_tree->_clear_val(m_id);
1296  }
void c4::yml::NodeRef::clear_children ( )
inline

remove the children from a scalar

Definition at line 1299 of file node.hpp.

1300  {
1301  assert_readable_();
1302  m_tree->remove_children(m_id);
1303  }
void remove_children(id_type node)
remove all the node's children, but keep the node itself
Definition: tree.cpp:917
void c4::yml::NodeRef::clear_style ( bool  recurse = false)
inline

Definition at line 1305 of file node.hpp.

Referenced by sample_json(), and sample_style().

1306  {
1307  assert_readable_();
1308  m_tree->clear_style(m_id, recurse);
1309  }
void clear_style(id_type node, bool recurse=false)
Definition: tree.cpp:1404
void c4::yml::NodeRef::set_style_conditionally ( NodeType  type_mask,
NodeType  rem_style_flags,
NodeType  add_style_flags,
bool  recurse = false 
)
inline

Definition at line 1311 of file node.hpp.

Referenced by sample_style().

1315  {
1316  assert_readable_();
1317  m_tree->set_style_conditionally(m_id, type_mask, rem_style_flags, add_style_flags, recurse);
1318  }
void set_style_conditionally(id_type node, NodeType type_mask, NodeType rem_style_flags, NodeType add_style_flags, bool recurse=false)
Definition: tree.cpp:1414
template<class T >
csubstr c4::yml::NodeRef::to_arena ( T const &  s)
inline

forward to Tree::to_arena() .

Serializes a scalar type to the tree's arena. The type must be serializeable as a scalar.

Definition at line 1330 of file node.hpp.

1331  {
1332  RYML_ASSERT_BASIC_(m_tree); // no need for valid or readable
1333  return m_tree->to_arena(s);
1334  }
csubstr to_arena(T const &a)
serialize the given variable to the tree's arena, growing it as needed to accomodate the serializatio...
Definition: tree.hpp:1349
template<class T >
void c4::yml::NodeRef::save ( T const &  k)
inline

Definition at line 1337 of file node.hpp.

Referenced by sample_float_precision(), sample_lightning_overview(), sample_std_types(), sample_user_container_types(), sample_user_container_types_brief(), and sample_user_scalar_types().

1338  {
1339  check_writeable_();
1340  create();
1341  write(*this, k);
1342  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write(NodeRef *n, T const &v)
Definition: node.hpp:2114
template<class T >
void c4::yml::NodeRef::save ( T const &  k,
NodeType  style_flags 
)
inline

Definition at line 1344 of file node.hpp.

1345  {
1346  check_writeable_();
1347  create();
1348  write(*this, k);
1349  RYML_ASSERT_BASIC_(!(style_flags & ~STYLE));
1350  _add_flags(style_flags);
1351  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write(NodeRef *n, T const &v)
Definition: node.hpp:2114
mask of SCALAR_STYLE | CONTAINER_STYLE : all style flags
Definition: node_type.hpp:183
template<class T >
void c4::yml::NodeRef::save_key ( T const &  k)
inline

Definition at line 1354 of file node.hpp.

1355  {
1356  check_writeable_();
1357  create();
1358  write_key(*this, k);
1359  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write_key(NodeRef *n, T const &v)
Definition: node.hpp:2119
template<class T >
void c4::yml::NodeRef::save_key ( T const &  k,
NodeType  style_flags 
)
inline

Definition at line 1361 of file node.hpp.

1362  {
1363  check_writeable_();
1364  create();
1365  write_key(*this, k);
1366  RYML_ASSERT_BASIC_(!(style_flags & ~STYLE));
1367  _add_flags(style_flags);
1368  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write_key(NodeRef *n, T const &v)
Definition: node.hpp:2119
mask of SCALAR_STYLE | CONTAINER_STYLE : all style flags
Definition: node_type.hpp:183
template<class T >
void c4::yml::NodeRef::set_serialized ( T const &  v)
inline

serialize a variable to this node.

If the variable is a scalar, it is first serialized to the arena, and then assigned to the node's val. Otherwise, the node will be made a container, and its contents populated from the variable.

Definition at line 1375 of file node.hpp.

Referenced by sample_base64(), sample_create_tree(), sample_create_tree_style(), sample_quick_overview(), sample_tree_arena(), c4::yml::write(), and write().

1376  {
1377  assert_writeable_();
1378  create();
1379  write(*this, v);
1380  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write(NodeRef *n, T const &v)
Definition: node.hpp:2114
template<class T >
void c4::yml::NodeRef::set_serialized ( T const &  v,
NodeType  style_flags 
)
inline

Definition at line 1382 of file node.hpp.

1383  {
1384  assert_writeable_();
1385  create();
1386  write(*this, v);
1387  RYML_ASSERT_BASIC_(!(style_flags & ~STYLE));
1388  _add_flags(style_flags);
1389  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write(NodeRef *n, T const &v)
Definition: node.hpp:2114
mask of SCALAR_STYLE | CONTAINER_STYLE : all style flags
Definition: node_type.hpp:183
template<class T >
void c4::yml::NodeRef::set_key_serialized ( T const &  k)
inline

serialize a variable, then assign the result to the node's key

Warning
The variable must be serialized as a scalar, ie it cannot be serialized as a container.

Definition at line 1396 of file node.hpp.

Referenced by sample_base64(), sample_create_tree_style(), sample_quick_overview(), and c4::yml::write().

1397  {
1398  assert_writeable_();
1399  create();
1400  write_key(*this, k);
1401  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write_key(NodeRef *n, T const &v)
Definition: node.hpp:2119
template<class T >
void c4::yml::NodeRef::set_key_serialized ( T const &  k,
NodeType  style_flags 
)
inline

Definition at line 1403 of file node.hpp.

1404  {
1405  assert_writeable_();
1406  create();
1407  write_key(*this, k);
1408  RYML_ASSERT_BASIC_(!(style_flags & ~STYLE));
1409  _add_flags(style_flags);
1410  }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
void write_key(NodeRef *n, T const &v)
Definition: node.hpp:2119
mask of SCALAR_STYLE | CONTAINER_STYLE : all style flags
Definition: node_type.hpp:183
NodeRef c4::yml::NodeRef::parent ( )
inline

Forward to Tree::parent().

Node must be readable.

Definition at line 1422 of file node.hpp.

Referenced by remove_child().

ConstNodeRef c4::yml::NodeRef::parent ( ) const
inline

Forward to Tree::parent().

Node must be readable.

Definition at line 1423 of file node.hpp.

NodeRef c4::yml::NodeRef::first_child ( )
inline

Forward to Tree::first_child().

Node must be readable.

Definition at line 1425 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::first_child ( ) const
inline

Forward to Tree::first_child().

Node must be readable.

Definition at line 1426 of file node.hpp.

NodeRef c4::yml::NodeRef::last_child ( )
inline

Forward to Tree::last_child().

Node must be readable.

Definition at line 1428 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::last_child ( ) const
inline

Forward to Tree::last_child().

Node must be readable.

Definition at line 1429 of file node.hpp.

NodeRef c4::yml::NodeRef::child ( id_type  pos)
inline

Forward to Tree::child().

Node must be readable.

Definition at line 1431 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::child ( id_type  pos) const
inline

Forward to Tree::child().

Node must be readable.

Definition at line 1432 of file node.hpp.

ReadResult c4::yml::NodeRef::child_r ( id_type  pos,
NodeRef *  child 
)
inline

Definition at line 1434 of file node.hpp.

1434 { assert_readable_(); child->m_tree = m_tree; ReadResult result = m_tree->child_r(m_id, pos, &child->m_id); return result; }; /**< Forward to @ref Tree::child_r(). Node must be readable. */
ReadResult child_r(id_type node, id_type pos, id_type *child_id) const
Definition: tree.hpp:582
NodeRef child(id_type pos) RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:1431
ReadResult c4::yml::NodeRef::child_r ( id_type  pos,
ConstNodeRef *  child 
) const
inline

Forward to Tree::child_r().

Node must be readable.

Definition at line 1435 of file node.hpp.

1435 { assert_readable_(); child->m_tree = m_tree; ReadResult result = m_tree->child_r(m_id, pos, &child->m_id); return result; }; /**< Forward to @ref Tree::child_r(). Node must be readable. */
ReadResult child_r(id_type node, id_type pos, id_type *child_id) const
Definition: tree.hpp:582
NodeRef child(id_type pos) RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:1431
NodeRef c4::yml::NodeRef::find_child ( csubstr  name)
inline

Forward to Tree::child_r().

Node must be readable. Forward to Tree::find_child(). Node must be readable.

Definition at line 1437 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::find_child ( csubstr  name) const
inline

Forward to Tree::find_child().

Node must be readable.

Definition at line 1438 of file node.hpp.

ReadResult c4::yml::NodeRef::find_child_r ( csubstr  name,
NodeRef *  child 
)
inline

Definition at line 1440 of file node.hpp.

1440 { assert_readable_(); child->m_tree = m_tree; ReadResult result = m_tree->find_child_r(m_id, name, &child->m_id); return result; }; /**< Forward to @ref Tree::find_child_r(). Node must be readable. */
ReadResult find_child_r(id_type node, csubstr const &key, id_type *child_id) const
like Tree::find_child(), but return a ReadResult with the status
Definition: tree.hpp:584
NodeRef child(id_type pos) RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:1431
ReadResult c4::yml::NodeRef::find_child_r ( csubstr  name,
ConstNodeRef *  child 
) const
inline

Forward to Tree::find_child_r().

Node must be readable.

Definition at line 1441 of file node.hpp.

1441 { assert_readable_(); child->m_tree = m_tree; ReadResult result = m_tree->find_child_r(m_id, name, &child->m_id); return result; }; /**< Forward to @ref Tree::find_child_r(). Node must be readable. */
ReadResult find_child_r(id_type node, csubstr const &key, id_type *child_id) const
like Tree::find_child(), but return a ReadResult with the status
Definition: tree.hpp:584
NodeRef child(id_type pos) RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:1431
NodeRef c4::yml::NodeRef::prev_sibling ( )
inline

Forward to Tree::find_child_r().

Node must be readable. Forward to Tree::prev_sibling(). Node must be readable.

Definition at line 1443 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::prev_sibling ( ) const
inline

Forward to Tree::prev_sibling().

Node must be readable.

Definition at line 1444 of file node.hpp.

NodeRef c4::yml::NodeRef::next_sibling ( )
inline

Forward to Tree::next_sibling().

Node must be readable.

Definition at line 1446 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::next_sibling ( ) const
inline

Forward to Tree::next_sibling().

Node must be readable.

Definition at line 1447 of file node.hpp.

NodeRef c4::yml::NodeRef::first_sibling ( )
inline

Forward to Tree::first_sibling().

Node must be readable.

Definition at line 1449 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::first_sibling ( ) const
inline

Forward to Tree::first_sibling().

Node must be readable.

Definition at line 1450 of file node.hpp.

NodeRef c4::yml::NodeRef::last_sibling ( )
inline

Forward to Tree::last_sibling().

Node must be readable.

Definition at line 1452 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::last_sibling ( ) const
inline

Forward to Tree::last_sibling().

Node must be readable.

Definition at line 1453 of file node.hpp.

NodeRef c4::yml::NodeRef::sibling ( id_type  pos)
inline

Forward to Tree::sibling().

Node must be readable.

Definition at line 1455 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::sibling ( id_type  pos) const
inline

Forward to Tree::sibling().

Node must be readable.

Definition at line 1456 of file node.hpp.

ReadResult c4::yml::NodeRef::sibling_r ( id_type  pos,
NodeRef *  sibling 
)
inline

Definition at line 1458 of file node.hpp.

1458 { assert_readable_(); sibling->m_tree = m_tree; ReadResult result = m_tree->sibling_r(m_id, pos, &sibling->m_id); return result; }; /**< Forward to @ref Tree::sibling_r(). Node must be readable. */
ReadResult sibling_r(id_type node, id_type pos, id_type *sibling_id) const
like Tree::sibling(), but return a ReadResult with the status
Definition: tree.hpp:597
NodeRef sibling(id_type pos) RYML_NOEXCEPT
Forward to Tree::sibling().
Definition: node.hpp:1455
ReadResult c4::yml::NodeRef::sibling_r ( id_type  pos,
ConstNodeRef *  sibling 
) const
inline

Forward to Tree::sibling_r().

Node must be readable.

Definition at line 1459 of file node.hpp.

1459 { assert_readable_(); sibling->m_tree = m_tree; ReadResult result = m_tree->sibling_r(m_id, pos, &sibling->m_id); return result; }; /**< Forward to @ref Tree::sibling_r(). Node must be readable. */
ReadResult sibling_r(id_type node, id_type pos, id_type *sibling_id) const
like Tree::sibling(), but return a ReadResult with the status
Definition: tree.hpp:597
NodeRef sibling(id_type pos) RYML_NOEXCEPT
Forward to Tree::sibling().
Definition: node.hpp:1455
NodeRef c4::yml::NodeRef::find_sibling ( csubstr  name)
inline

Forward to Tree::sibling_r().

Node must be readable. Forward to Tree::find_sibling(). Node must be readable.

Definition at line 1461 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::find_sibling ( csubstr  name) const
inline

Forward to Tree::find_sibling().

Node must be readable.

Definition at line 1462 of file node.hpp.

ReadResult c4::yml::NodeRef::find_sibling_r ( csubstr  name,
NodeRef *  sibling 
)
inline

Definition at line 1464 of file node.hpp.

1464 { assert_readable_(); sibling->m_tree = m_tree; ReadResult result = m_tree->find_sibling_r(m_id, name, &sibling->m_id); return result; }; /**< Forward to @ref Tree::find_sibling_r(). Node must be readable. */
ReadResult find_sibling_r(id_type node, csubstr const &key, id_type *sibling_id) const
like Tree::find_sibling(), but return a ReadResult if with the status
Definition: tree.hpp:599
NodeRef sibling(id_type pos) RYML_NOEXCEPT
Forward to Tree::sibling().
Definition: node.hpp:1455
ReadResult c4::yml::NodeRef::find_sibling_r ( csubstr  name,
ConstNodeRef *  sibling 
) const
inline

Forward to Tree::find_sibling_r().

Node must be readable.

Definition at line 1465 of file node.hpp.

1465 { assert_readable_(); sibling->m_tree = m_tree; ReadResult result = m_tree->find_sibling_r(m_id, name, &sibling->m_id); return result; }; /**< Forward to @ref Tree::find_sibling_r(). Node must be readable. */
ReadResult find_sibling_r(id_type node, csubstr const &key, id_type *sibling_id) const
like Tree::find_sibling(), but return a ReadResult if with the status
Definition: tree.hpp:599
NodeRef sibling(id_type pos) RYML_NOEXCEPT
Forward to Tree::sibling().
Definition: node.hpp:1455
NodeRef c4::yml::NodeRef::ancestor_doc ( )
inline

Forward to Tree::find_sibling_r().

Node must be readable. Forward to Tree::ancestor_doc(). Node must be readable.

Definition at line 1467 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::ancestor_doc ( ) const
inline

Forward to Tree::ancestor_doc().

Node must be readable.

Definition at line 1468 of file node.hpp.

NodeRef c4::yml::NodeRef::doc ( id_type  i)
inline

Forward to Tree::doc().

Node must be readable.

Definition at line 1470 of file node.hpp.

ConstNodeRef c4::yml::NodeRef::doc ( id_type  i) const
inline

Forward to Tree::doc().

Node must be readable. succeeds even when the node may have invalid or seed id

Definition at line 1471 of file node.hpp.

NodeRef c4::yml::NodeRef::operator[] ( csubstr  key)
inline

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.

Warning
the calling object must be readable. This precondition is asserted. The assertion is performed only if RYML_USE_ASSERT is set to true. As with the non-const overload, it is UB to call this method if the node is not readable.
See also
https://github.com/biojppm/rapidyaml/issues/389

Definition at line 1499 of file node.hpp.

1500  {
1501  assert_readable_();
1502  id_type ch = m_tree->find_child(m_id, key);
1503  return ch != NONE ? NodeRef(m_tree, ch) : NodeRef(m_tree, m_id, key);
1504  }
an index to none
Definition: common.hpp:131
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
NodeRef() noexcept
Definition: node.hpp:1106
id_type find_child(id_type node, csubstr const &key) const
find child by name, or NONE if no child is found with this key like Tree::child(), but return a ReadResult with the status
Definition: tree.cpp:1249
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
NodeRef c4::yml::NodeRef::operator[] ( id_type  pos)
inline

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.

Warning
the calling object must be readable. This precondition is asserted. The assertion is performed only if RYML_USE_ASSERT is set to true. As with the non-const overload, it is UB to call this method if the node is not readable.
See also
https://github.com/biojppm/rapidyaml/issues/389

Definition at line 1524 of file node.hpp.

1525  {
1526  assert_readable_();
1527  id_type ch = m_tree->child(m_id, pos);
1528  return ch != NONE ? NodeRef(m_tree, ch) : NodeRef(m_tree, m_id, pos);
1529  }
an index to none
Definition: common.hpp:131
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
id_type child(id_type node, id_type pos) const
find child by position, or NONE if there are less than pos children posi
Definition: tree.cpp:1237
NodeRef() noexcept
Definition: node.hpp:1106
ConstNodeRef c4::yml::NodeRef::operator[] ( csubstr  key) const
inline

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.

See also
https://github.com/biojppm/rapidyaml/issues/389

Definition at line 1540 of file node.hpp.

1541  {
1542  assert_readable_();
1543  id_type ch = m_tree->find_child(m_id, key);
1544  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
1545  return {m_tree, ch};
1546  }
an index to none
Definition: common.hpp:131
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
Callbacks m_callbacks
Definition: tree.hpp:1686
id_type find_child(id_type node, csubstr const &key) const
find child by name, or NONE if no child is found with this key like Tree::child(), but return a ReadResult with the status
Definition: tree.cpp:1249
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
ConstNodeRef c4::yml::NodeRef::operator[] ( id_type  pos) const
inline

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.

See also
https://github.com/biojppm/rapidyaml/issues/389

Definition at line 1557 of file node.hpp.

1558  {
1559  assert_readable_();
1560  id_type ch = m_tree->child(m_id, pos);
1561  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
1562  return {m_tree, ch};
1563  }
an index to none
Definition: common.hpp:131
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
id_type child(id_type node, id_type pos) const
find child by position, or NONE if there are less than pos children posi
Definition: tree.cpp:1237
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef c4::yml::NodeRef::at ( csubstr  key)
inline

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.

Warning
This method will call the error callback (regardless of build type or of the value of RYML_USE_ASSERT) whenever any of the following preconditions is violated: a) the object is valid (points at a tree and a node), b) the calling object must be readable (must not be in seed state), c) the calling object must be pointing at a MAP node. The preconditions are similar to the non-const operator[](csubstr), but instead of using assertions, this function directly checks those conditions and calls the error callback if any of the checks fail.
Note
since it is valid behavior for the returned node to be in seed state, the error callback is not invoked when this happens.

Definition at line 1604 of file node.hpp.

1605  {
1606  RYML_CHECK_BASIC_(m_tree != nullptr);
1607  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, (m_id >= 0 && m_id < m_tree->capacity()), m_tree, m_id);
1608  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, readable(), m_tree, m_id);
1609  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, m_tree->is_map(m_id), m_tree, m_id);
1610  id_type ch = m_tree->find_child(m_id, key);
1611  return ch != NONE ? NodeRef(m_tree, ch) : NodeRef(m_tree, m_id, key);
1612  }
an index to none
Definition: common.hpp:131
bool is_map(id_type node) const
Definition: tree.hpp:480
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
bool readable() const noexcept
true if the object is not invalid and not in seed state.
Definition: node.hpp:1138
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef() noexcept
Definition: node.hpp:1106
id_type find_child(id_type node, csubstr const &key) const
find child by name, or NONE if no child is found with this key like Tree::child(), but return a ReadResult with the status
Definition: tree.cpp:1249
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
NodeRef c4::yml::NodeRef::at ( id_type  pos)
inline

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.

Warning
This method will call the error callback (regardless of build type or of the value of RYML_USE_ASSERT) whenever any of the following preconditions is violated: a) the object is valid (points at a tree and a node), b) the calling object must be readable (must not be in seed state), c) the calling object must be pointing at a MAP node. The preconditions are similar to the non-const operator[](id_type), but instead of using assertions, this function directly checks those conditions and calls the error callback if any of the checks fail.
Note
since it is valid behavior for the returned node to be in seed state, the error callback is not invoked when this happens.

Definition at line 1639 of file node.hpp.

1640  {
1641  RYML_CHECK_BASIC_(m_tree != nullptr);
1642  const id_type cap = m_tree->capacity();
1643  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, (m_id >= 0 && m_id < cap), m_tree, m_id);
1644  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, (pos >= 0 && pos < cap), m_tree, m_id);
1645  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, readable(), m_tree, m_id);
1646  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, m_tree->is_container(m_id), m_tree, m_id);
1647  id_type ch = m_tree->child(m_id, pos);
1648  return ch != NONE ? NodeRef(m_tree, ch) : NodeRef(m_tree, m_id, pos);
1649  }
bool is_container(id_type node) const
Definition: tree.hpp:479
an index to none
Definition: common.hpp:131
id_type capacity() const
Definition: tree.hpp:346
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
bool readable() const noexcept
true if the object is not invalid and not in seed state.
Definition: node.hpp:1138
id_type child(id_type node, id_type pos) const
find child by position, or NONE if there are less than pos children posi
Definition: tree.cpp:1237
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef() noexcept
Definition: node.hpp:1106
ConstNodeRef c4::yml::NodeRef::at ( csubstr  key) const
inline

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 1660 of file node.hpp.

1661  {
1662  RYML_CHECK_BASIC_(m_tree != nullptr);
1663  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, (m_id >= 0 && m_id < m_tree->capacity()), m_tree, m_id);
1664  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, readable(), m_tree, m_id);
1665  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, m_tree->is_map(m_id), m_tree, m_id);
1666  id_type ch = m_tree->find_child(m_id, key);
1667  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
1668  return {m_tree, ch};
1669  }
an index to none
Definition: common.hpp:131
bool is_map(id_type node) const
Definition: tree.hpp:480
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
bool readable() const noexcept
true if the object is not invalid and not in seed state.
Definition: node.hpp:1138
Callbacks m_callbacks
Definition: tree.hpp:1686
id_type find_child(id_type node, csubstr const &key) const
find child by name, or NONE if no child is found with this key like Tree::child(), but return a ReadResult with the status
Definition: tree.cpp:1249
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
ConstNodeRef c4::yml::NodeRef::at ( id_type  pos) const
inline

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 1680 of file node.hpp.

1681  {
1682  RYML_CHECK_BASIC_(m_tree != nullptr);
1683  const id_type cap = m_tree->capacity();
1684  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, (m_id >= 0 && m_id < cap), m_tree, m_id);
1685  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, (pos >= 0 && pos < cap), m_tree, m_id);
1686  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, readable(), m_tree, m_id);
1687  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, m_tree->is_container(m_id), m_tree, m_id);
1688  const id_type ch = m_tree->child(m_id, pos);
1689  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
1690  return {m_tree, ch};
1691  }
bool is_container(id_type node) const
Definition: tree.hpp:479
an index to none
Definition: common.hpp:131
id_type capacity() const
Definition: tree.hpp:346
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
bool readable() const noexcept
true if the object is not invalid and not in seed state.
Definition: node.hpp:1138
id_type child(id_type node, id_type pos) const
find child by position, or NONE if there are less than pos children posi
Definition: tree.cpp:1237
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef c4::yml::NodeRef::insert_child ( NodeRef  after)
inline

Definition at line 1700 of file node.hpp.

1701  {
1702  assert_readable_();
1703  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, after.m_tree == m_tree, m_tree, m_id);
1704  NodeRef r(m_tree, m_tree->insert_child(m_id, after.m_id));
1705  return r;
1706  }
id_type insert_child(id_type parent, id_type after)
create and insert a new child of parent.
Definition: tree.hpp:1168
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef() noexcept
Definition: node.hpp:1106
NodeRef c4::yml::NodeRef::prepend_child ( )
inline

Definition at line 1708 of file node.hpp.

1709  {
1710  assert_readable_();
1711  NodeRef r(m_tree, m_tree->insert_child(m_id, NONE));
1712  return r;
1713  }
an index to none
Definition: common.hpp:131
id_type insert_child(id_type parent, id_type after)
create and insert a new child of parent.
Definition: tree.hpp:1168
NodeRef() noexcept
Definition: node.hpp:1106
NodeRef c4::yml::NodeRef::append_child ( )
inline

Definition at line 1715 of file node.hpp.

Referenced by sample_anchors_and_aliases_create(), sample_base64(), sample_create_tree(), sample_create_tree_style(), sample_float_precision(), sample_lightning_overview(), sample_parse_reuse_tree(), sample_quick_overview(), and c4::yml::write().

1716  {
1717  assert_readable_();
1718  NodeRef r(m_tree, m_tree->append_child(m_id));
1719  return r;
1720  }
id_type append_child(id_type parent)
create and insert a node as the last child of parent
Definition: tree.hpp:1180
NodeRef() noexcept
Definition: node.hpp:1106
NodeRef c4::yml::NodeRef::insert_sibling ( ConstNodeRef const &  after)
inline

Definition at line 1722 of file node.hpp.

1723  {
1724  assert_readable_();
1725  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, after.m_tree == m_tree, m_tree, m_id);
1726  NodeRef r(m_tree, m_tree->insert_sibling(m_id, after.m_id));
1727  return r;
1728  }
id_type insert_sibling(id_type node, id_type after)
create and insert a new sibling of n. insert after "after"
Definition: tree.hpp:1191
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef() noexcept
Definition: node.hpp:1106
NodeRef c4::yml::NodeRef::prepend_sibling ( )
inline

Definition at line 1730 of file node.hpp.

1731  {
1732  assert_readable_();
1733  NodeRef r(m_tree, m_tree->prepend_sibling(m_id));
1734  return r;
1735  }
id_type prepend_sibling(id_type node)
create and insert a node as the first node of parent
Definition: tree.hpp:1196
NodeRef() noexcept
Definition: node.hpp:1106
NodeRef c4::yml::NodeRef::append_sibling ( )
inline

Definition at line 1737 of file node.hpp.

1738  {
1739  assert_readable_();
1740  NodeRef r(m_tree, m_tree->append_sibling(m_id));
1741  return r;
1742  }
id_type append_sibling(id_type node)
Definition: tree.hpp:1197
NodeRef() noexcept
Definition: node.hpp:1106
void c4::yml::NodeRef::remove_child ( NodeRef &  child)
inline

Definition at line 1746 of file node.hpp.

1747  {
1748  assert_readable_();
1749  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, has_child(child), m_tree, m_id);
1750  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, child.parent().id() == id(), m_tree, m_id);
1751  m_tree->remove(child.id());
1752  child = NodeRef{};
1753  }
bool has_child(ConstNodeRef const &n) const RYML_NOEXCEPT
Forward to Tree::has_child().
Definition: node.hpp:282
NodeRef child(id_type pos) RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:1431
NodeRef parent() RYML_NOEXCEPT
Forward to Tree::parent().
Definition: node.hpp:1422
id_type id() const noexcept
Definition: node.hpp:1208
void remove(id_type node)
remove an entire branch at once: ie remove the children and the node itself
Definition: tree.hpp:1202
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef() noexcept
Definition: node.hpp:1106
void c4::yml::NodeRef::remove_child ( id_type  pos)
inline

remove the nth child of this node

Definition at line 1756 of file node.hpp.

1757  {
1758  assert_readable_();
1759  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, pos >= 0 && pos < num_children(), m_tree, m_id);
1760  id_type child = m_tree->child(m_id, pos);
1761  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, child != NONE, m_tree, m_id);
1762  m_tree->remove(child);
1763  }
an index to none
Definition: common.hpp:131
NodeRef child(id_type pos) RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:1431
id_type num_children() const RYML_NOEXCEPT
O(num_children).
Definition: node.hpp:302
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
id_type child(id_type node, id_type pos) const
find child by position, or NONE if there are less than pos children posi
Definition: tree.cpp:1237
void remove(id_type node)
remove an entire branch at once: ie remove the children and the node itself
Definition: tree.hpp:1202
Callbacks m_callbacks
Definition: tree.hpp:1686
void c4::yml::NodeRef::remove_child ( csubstr  key)
inline

remove a child by name

Definition at line 1766 of file node.hpp.

1767  {
1768  assert_readable_();
1769  id_type child = m_tree->find_child(m_id, key);
1770  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, child != NONE, m_tree, m_id);
1771  m_tree->remove(child);
1772  }
an index to none
Definition: common.hpp:131
NodeRef child(id_type pos) RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:1431
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
void remove(id_type node)
remove an entire branch at once: ie remove the children and the node itself
Definition: tree.hpp:1202
Callbacks m_callbacks
Definition: tree.hpp:1686
id_type find_child(id_type node, csubstr const &key) const
find child by name, or NONE if no child is found with this key like Tree::child(), but return a ReadResult with the status
Definition: tree.cpp:1249
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
void c4::yml::NodeRef::move ( NodeRef const &  parent,
ConstNodeRef const &  after 
)
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 1780 of file node.hpp.

1781  {
1782  assert_readable_();
1783  parent.assert_readable_();
1784  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, parent.m_tree == after.m_tree || after.m_id == NONE, m_tree, m_id);
1785  if(parent.m_tree == m_tree)
1786  {
1787  m_tree->move(m_id, parent.m_id, after.m_id);
1788  }
1789  else
1790  {
1791  parent.m_tree->move(m_tree, m_id, parent.m_id, after.m_id);
1792  m_tree = parent.m_tree;
1793  }
1794  }
an index to none
Definition: common.hpp:131
void move(id_type node, id_type after)
change the node's position in the parent
Definition: tree.cpp:817
NodeRef parent() RYML_NOEXCEPT
Forward to Tree::parent().
Definition: node.hpp:1422
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef c4::yml::NodeRef::duplicate ( NodeRef const &  parent,
ConstNodeRef const &  after 
) const
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 1801 of file node.hpp.

1802  {
1803  assert_readable_();
1804  parent.assert_readable_();
1805  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, parent.m_tree == after.m_tree || after.m_id == NONE, m_tree, m_id);
1806  id_type dup = parent.m_tree->duplicate(m_tree, m_id, parent.m_id, after.m_id);
1807  NodeRef r(parent.m_tree, dup);
1808  return r;
1809  }
id_type duplicate(id_type node, id_type new_parent, id_type after)
recursively duplicate a node from this tree into a new parent, placing it after one of its children ...
Definition: tree.cpp:960
an index to none
Definition: common.hpp:131
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
NodeRef parent() RYML_NOEXCEPT
Forward to Tree::parent().
Definition: node.hpp:1422
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef() noexcept
Definition: node.hpp:1106
NodeRef c4::yml::NodeRef::duplicate_children ( NodeRef const &  parent,
ConstNodeRef const &  after 
) const
inline

Definition at line 1811 of file node.hpp.

1812  {
1813  assert_readable_();
1814  parent.assert_readable_();
1815  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, parent.m_tree == after.m_tree || after.m_id == NONE, m_tree, m_id);
1816  id_type last_dup = parent.m_tree->duplicate_children(m_tree, m_id, parent.m_id, after.m_id);
1817  NodeRef r(parent.m_tree, last_dup);
1818  return r;
1819  }
id_type duplicate_children(id_type node, id_type parent, id_type after)
recursively duplicate the node's children (but not the node)
Definition: tree.cpp:983
an index to none
Definition: common.hpp:131
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
Definition: common.hpp:124
NodeRef parent() RYML_NOEXCEPT
Forward to Tree::parent().
Definition: node.hpp:1422
Callbacks m_callbacks
Definition: tree.hpp:1686
NodeRef() noexcept
Definition: node.hpp:1106
iterator c4::yml::NodeRef::begin ( )
inline

get a mutable iterator to the first child.

NOT AVAILABLE for ConstNodeRef.

Definition at line 1834 of file node.hpp.

const_iterator c4::yml::NodeRef::begin ( ) const
inline

get an iterator to the first child

Definition at line 1835 of file node.hpp.

const_iterator c4::yml::NodeRef::cbegin ( ) const
inline

get an iterator to the first child

Definition at line 1836 of file node.hpp.

iterator c4::yml::NodeRef::end ( )
inline

get an iterator to after the last child.

NOT AVAILABLE for ConstNodeRef.

Definition at line 1838 of file node.hpp.

const_iterator c4::yml::NodeRef::end ( ) const
inline

get an iterator to after the last child

Definition at line 1839 of file node.hpp.

const_iterator c4::yml::NodeRef::cend ( ) const
inline

get an iterator to after the last child

Definition at line 1840 of file node.hpp.

children_view c4::yml::NodeRef::children ( )
inline

get an iterable view over children

Definition at line 1843 of file node.hpp.

Referenced by sample_float_precision().

const_children_view c4::yml::NodeRef::children ( ) const
inline

get an iterable view over children

Definition at line 1844 of file node.hpp.

const_children_view c4::yml::NodeRef::cchildren ( ) const
inline

get an iterable view over children

Definition at line 1845 of file node.hpp.

children_view c4::yml::NodeRef::siblings ( )
inline

Definition at line 1847 of file node.hpp.

1847 { assert_readable_(); return detail::make_siblings_view<children_view>(m_tree, m_id); } /** get an iterable view over all siblings (including the calling node) */
const_children_view c4::yml::NodeRef::siblings ( ) const
inline

get an iterable view over all siblings (including the calling node)

Definition at line 1848 of file node.hpp.

1848 { assert_readable_(); return detail::make_siblings_view<const_children_view>(m_tree, m_id); } /** get an iterable view over all siblings (including the calling node) */
const_children_view c4::yml::NodeRef::csiblings ( ) const
inline

get an iterable view over all siblings (including the calling node)

Definition at line 1849 of file node.hpp.

1849 { assert_readable_(); return detail::make_siblings_view<const_children_view>(m_tree, m_id); } /** get an iterable view over all siblings (including the calling node) */
void c4::yml::NodeRef::operator= ( type_bits  t)
inline

Definition at line 1865 of file node.hpp.

1865 { create(); m_tree->_p(m_id)->m_type = t; }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
NodeData * _p(id_type node)
An if-less form of get() that demands a valid node index. This function is implementation only; use a...
Definition: tree.hpp:380
NodeType m_type
Definition: tree.hpp:289
void c4::yml::NodeRef::operator|= ( type_bits  t)
inline

Definition at line 1868 of file node.hpp.

1868 { create(); m_tree->_add_flags(m_id, t); }
void create()
if this node is in seed state, create the node in the tree
Definition: node.hpp:1225
NodeRef& c4::yml::NodeRef::operator= ( csubstr  v)
inline

Definition at line 1871 of file node.hpp.

1871 { set_val(v); return *this; }
void set_val(csubstr val)
Definition: node.hpp:1251
template<size_t N>
NodeRef& c4::yml::NodeRef::operator= ( const char(&)  v[N])
inline

Definition at line 1875 of file node.hpp.

1875 { csubstr sv; sv.assign<N>(v); set_val(sv); return *this; }
void set_val(csubstr val)
Definition: node.hpp:1251
basic_substring< const char > csubstr
an immutable string view
Definition: substr.hpp:2356
void assign(C(&s_)[N]) noexcept
Assign from an array.
Definition: substr.hpp:300
NodeRef& c4::yml::NodeRef::operator= ( std::nullptr_t  )
inline

Definition at line 1878 of file node.hpp.

1878 { set_val(csubstr{}); return *this; }
void set_val(csubstr val)
Definition: node.hpp:1251
basic_substring< const char > csubstr
an immutable string view
Definition: substr.hpp:2356
template<class T >
NodeRef& c4::yml::NodeRef::operator= ( Key< T > const &  v)
inline

Definition at line 1882 of file node.hpp.

1882 { set_key(v.k); return *this; }
void set_key(csubstr key)
Definition: node.hpp:1248
template<class T >
NodeRef& c4::yml::NodeRef::operator<< ( T const &  v)
inline

Definition at line 1886 of file node.hpp.

1886 { save(v); return *this; }
void save(T const &k)
Definition: node.hpp:1337
NodeRef& c4::yml::NodeRef::operator<< ( csubstr  v)
inline

Definition at line 1889 of file node.hpp.

1889 { save(v); return *this; }
void save(T const &k)
Definition: node.hpp:1337
template<class T >
NodeRef& c4::yml::NodeRef::operator<< ( Key< T > const &  v)
inline

Definition at line 1893 of file node.hpp.

1893 { save_key(v.k); return *this; }
void save_key(T const &k)
Definition: node.hpp:1354
NodeType c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::type ( ) const
inlineinherited

Forward to Tree::type().

Node must be readable.

Definition at line 172 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::key ( ) const
inlineinherited

Forward to Tree::key().

Node must be readable.

Definition at line 174 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::key_tag ( ) const
inlineinherited

Forward to Tree::key_tag().

Node must be readable.

Definition at line 175 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::key_ref ( ) const
inlineinherited

Forward to Tree::key_ref().

Node must be readable.

Definition at line 176 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::key_anchor ( ) const
inlineinherited

Forward to Tree::key_anchor().

Node must be readable.

Definition at line 177 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::val ( ) const
inlineinherited

Forward to Tree::val().

Node must be readable.

Definition at line 179 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::val_tag ( ) const
inlineinherited

Forward to Tree::val_tag().

Node must be readable.

Definition at line 180 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::val_ref ( ) const
inlineinherited

Forward to Tree::val_ref().

Node must be readable.

Definition at line 181 of file node.hpp.

csubstr c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::val_anchor ( ) const
inlineinherited

Forward to Tree::val_anchor().

Node must be readable.

Definition at line 182 of file node.hpp.

NodeScalar const& c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::keysc ( ) const
inlineinherited

Forward to Tree::keysc().

Node must be readable.

Definition at line 184 of file node.hpp.

NodeScalar const& c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::valsc ( ) const
inlineinherited

Forward to Tree::valsc().

Node must be readable.

Definition at line 185 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::key_is_null ( ) const
inlineinherited

Forward to Tree::key_is_null().

Node must be readable.

Definition at line 187 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::val_is_null ( ) const
inlineinherited

Forward to Tree::val_is_null().

Node must be readable.

Definition at line 188 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_unfiltered ( ) const
inlinenoexceptinherited

Forward to Tree::is_key_unfiltered().

Node must be readable.

Definition at line 190 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_unfiltered ( ) const
inlinenoexceptinherited

Forward to Tree::is_val_unfiltered().

Node must be readable.

Definition at line 191 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::empty ( ) const
inlineinherited

Forward to Tree::empty().

Node must be readable.

Definition at line 203 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_stream ( ) const
inlineinherited

Forward to Tree::is_stream().

Node must be readable.

Definition at line 204 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_doc ( ) const
inlineinherited

Forward to Tree::is_doc().

Node must be readable.

Definition at line 205 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_container ( ) const
inlineinherited

Forward to Tree::is_container().

Node must be readable.

Definition at line 206 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_map ( ) const
inlineinherited

Forward to Tree::is_map().

Node must be readable.

Definition at line 207 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_seq ( ) const
inlineinherited

Forward to Tree::is_seq().

Node must be readable.

Definition at line 208 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_val ( ) const
inlineinherited

Forward to Tree::has_val().

Node must be readable.

Definition at line 209 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_key ( ) const
inlineinherited

Forward to Tree::has_key().

Node must be readable.

Definition at line 210 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val ( ) const
inlineinherited

Forward to Tree::is_val().

Node must be readable.

Definition at line 211 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_keyval ( ) const
inlineinherited

Forward to Tree::is_keyval().

Node must be readable.

Definition at line 212 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_key_tag ( ) const
inlineinherited

Forward to Tree::has_key_tag().

Node must be readable.

Definition at line 213 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_val_tag ( ) const
inlineinherited

Forward to Tree::has_val_tag().

Node must be readable.

Definition at line 214 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_key_anchor ( ) const
inlineinherited

Forward to Tree::has_key_anchor().

Node must be readable.

Definition at line 215 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_val_anchor ( ) const
inlineinherited

Forward to Tree::has_val_anchor().

Node must be readable.

Definition at line 216 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_anchor ( ) const
inlineinherited

Forward to Tree::has_anchor().

Node must be readable.

Definition at line 217 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_ref ( ) const
inlineinherited

Forward to Tree::is_key_ref().

Node must be readable.

Definition at line 218 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_ref ( ) const
inlineinherited

Forward to Tree::is_val_ref().

Node must be readable.

Definition at line 219 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_ref ( ) const
inlineinherited

Forward to Tree::is_ref().

Node must be readable.

Definition at line 220 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::parent_is_seq ( ) const
inlineinherited

Forward to Tree::parent_is_seq().

Node must be readable.

Definition at line 221 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::parent_is_map ( ) const
inlineinherited

Forward to Tree::parent_is_map().

Node must be readable.

Definition at line 222 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::type_has_any ( type_bits  bits) const
inlineinherited

Forward to Tree::type_has_any().

Node must be readable.

Definition at line 234 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::type_has_all ( type_bits  bits) const
inlineinherited

Forward to Tree::type_has_all().

Node must be readable.

Definition at line 235 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::type_has_none ( type_bits  bits) const
inlineinherited

Forward to Tree::type_has_none().

Node must be readable.

Definition at line 236 of file node.hpp.

NodeType c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::key_style ( ) const
inlineinherited

Forward to Tree::key_style().

Node must be readable.

Definition at line 238 of file node.hpp.

NodeType c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::val_style ( ) const
inlineinherited

Forward to Tree::val_style().

Node must be readable.

Definition at line 239 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_container_styled ( ) const
inlineinherited

Forward to Tree::is_container_styled().

Node must be readable.

Definition at line 241 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_block ( ) const
inlineinherited

Forward to Tree::is_block().

Node must be readable.

Definition at line 242 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_flow ( ) const
inlineinherited

Forward to Tree::is_flow().

Node must be readable.

Definition at line 243 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_flow_sl ( ) const
inlineinherited

Forward to Tree::is_flow_sl().

Node must be readable.

Definition at line 244 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_flow_ml ( ) const
inlineinherited

Forward to Tree::is_flow_ml1().

Node must be readable.

Definition at line 246 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_flow_ml1 ( ) const
inlineinherited

Forward to Tree::is_flow_ml1().

Node must be readable.

Definition at line 247 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_flow_mln ( ) const
inlineinherited

Forward to Tree::is_flow_mln().

Node must be readable.

Definition at line 248 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_flow_mlx ( ) const
inlineinherited

Forward to Tree::is_flow_mlx().

Node must be readable.

Definition at line 249 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_flow_space ( ) const
inlineinherited

Forward to Tree::has_flow_space().

Node must be readable.

Definition at line 250 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_styled ( ) const
inlineinherited

Forward to Tree::is_key_styled().

Node must be readable.

Definition at line 252 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_styled ( ) const
inlineinherited

Forward to Tree::is_val_styled().

Node must be readable.

Definition at line 253 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_literal ( ) const
inlineinherited

Forward to Tree::is_key_literal().

Node must be readable.

Definition at line 254 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_literal ( ) const
inlineinherited

Forward to Tree::is_val_literal().

Node must be readable.

Definition at line 255 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_folded ( ) const
inlineinherited

Forward to Tree::is_key_folded().

Node must be readable.

Definition at line 256 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_folded ( ) const
inlineinherited

Forward to Tree::is_val_folded().

Node must be readable.

Definition at line 257 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_squo ( ) const
inlineinherited

Forward to Tree::is_key_squo().

Node must be readable.

Definition at line 258 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_squo ( ) const
inlineinherited

Forward to Tree::is_val_squo().

Node must be readable.

Definition at line 259 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_dquo ( ) const
inlineinherited

Forward to Tree::is_key_dquo().

Node must be readable.

Definition at line 260 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_dquo ( ) const
inlineinherited

Forward to Tree::is_val_dquo().

Node must be readable.

Definition at line 261 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_plain ( ) const
inlineinherited

Forward to Tree::is_key_plain().

Node must be readable.

Definition at line 262 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_plain ( ) const
inlineinherited

Forward to Tree::is_val_plain().

Node must be readable.

Definition at line 263 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_key_quoted ( ) const
inlineinherited

Forward to Tree::is_key_quoted().

Node must be readable.

Definition at line 264 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_val_quoted ( ) const
inlineinherited

Forward to Tree::is_val_quoted().

Node must be readable.

Definition at line 265 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_quoted ( ) const
inlineinherited

Forward to Tree::is_quoted().

Node must be readable.

Definition at line 266 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_root ( ) const
inlineinherited

Forward to Tree::is_root().

Node must be readable.

Definition at line 278 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_parent ( ) const
inlineinherited

Forward to Tree::has_parent() Node must be readable.

Definition at line 279 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::is_ancestor ( ConstNodeRef const &  ancestor) const
inlineinherited

Forward to Tree::is_ancestor() Node must be readable.

Definition at line 280 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_child ( ConstNodeRef const &  n) const
inlineinherited

Forward to Tree::has_child().

Node must be readable.

Definition at line 282 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_child ( id_type  node) const
inlineinherited

Forward to Tree::has_child().

Node must be readable.

Definition at line 283 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_child ( csubstr  name) const
inlineinherited

Forward to Tree::has_child().

Node must be readable.

Definition at line 284 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_children ( ) const
inlineinherited

Forward to Tree::has_children().

Node must be readable.

Definition at line 285 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_sibling ( ConstNodeRef const &  n) const
inlineinherited

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 287 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_sibling ( id_type  node) const
inlineinherited

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 288 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_sibling ( csubstr  name) const
inlineinherited

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 289 of file node.hpp.

bool c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::has_other_siblings ( ) const
inlineinherited

Forward to Tree::has_other_siblings().

Node must be readable.

Definition at line 290 of file node.hpp.

id_type c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::num_children ( ) const
inlineinherited

O(num_children).

Forward to Tree::num_children().

Definition at line 302 of file node.hpp.

id_type c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::num_siblings ( ) const
inlineinherited

O(num_children).

Forward to Tree::num_siblings().

Definition at line 303 of file node.hpp.

id_type c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::num_other_siblings ( ) const
inlineinherited

O(num_siblings).

Forward to Tree::num_other_siblings().

Definition at line 304 of file node.hpp.

id_type c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::child_pos ( ConstNodeRef const &  n) const
inlineinherited

O(num_children).

Forward to Tree::child_pos().

Definition at line 305 of file node.hpp.

id_type c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::sibling_pos ( ConstNodeRef const &  n) const
inlineinherited

O(num_siblings).

Forward to Tree::sibling_pos().

Definition at line 306 of file node.hpp.

id_type c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::depth_asc ( ) const
inlineinherited

Definition at line 308 of file node.hpp.

308 { this_assert_readable_(); return tree_->depth_asc(id_); } /** O(log(num_nodes)). Forward to Tree::depth_asc(). Node must be readable. */
id_type c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::depth_desc ( ) const
inlineinherited

O(log(num_nodes)).

Forward to Tree::depth_asc(). Node must be readable.

Definition at line 309 of file node.hpp.

309 { this_assert_readable_(); return tree_->depth_desc(id_); } /** O(num_nodes). Forward to Tree::depth_desc(). Node must be readable. */
Location c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::location ( Parser const &  parser) const
inlineinherited

Definition at line 318 of file node.hpp.

319  {
320  this_assert_readable_();
321  return tree_->location(parser, id_);
322  }
Parser parser
Definition: parse.cpp:117
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::load ( T *  v,
bool  check_readable = true 
) const
inlineinherited

(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-overrideable read() function, which can be for ConstNodeRef (see Read from ConstNodeRef) or for tree+id (see Read from Tree).

This method differs from ConstNodeRef::deserialize() in that here the error callback is called if the deserialization failed, or (optionally) the node is not readable.

Definition at line 345 of file node.hpp.

346  {
347  if(check_readable)
348  check_val_();
349  else
350  assert_val_(); // assert otherwise
351  // we can call read() directly because we checked everything
352  // (or the caller told us so)
353  // use the adapter ctor to accomodate legacy read() implementations
354  const ReadResult result(read((ConstImpl const&)*this, v), id_);
355  if C4_UNLIKELY(!result)
356  err_visit_(tree_, result.node, "could not deserialize node");
357  }
static void err_visit_(Tree const *tree, id_type id, const char *msg)
Definition: node.hpp:615
ReadResult deserialize(T *v) const
(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-...
Definition: node.hpp:428
ReadResult read(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2080
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::load ( Wrapper const &  wrapper,
bool  check_readable = true 
) const
inlineinherited

(2) like (1), but for wrapper tag types such as c4::fmt::base64()

Definition at line 361 of file node.hpp.

362  {
363  RYML_CHECK_TYPE_IS_WRAPPER_LIKE_(Wrapper);
364  if(check_readable)
365  check_val_();
366  else
367  assert_val_(); // assert otherwise
368  // we can call read() directly because we checked everything
369  // (or the caller told us so)
370  // use the adapter ctor to accomodate legacy read() implementations
371  const ReadResult result(read((ConstImpl const&)*this, wrapper), id_);
372  if C4_UNLIKELY(!result)
373  err_visit_(tree_, result.node, "could not deserialize node");
374  }
static void err_visit_(Tree const *tree, id_type id, const char *msg)
Definition: node.hpp:615
ReadResult deserialize(T *v) const
(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-...
Definition: node.hpp:428
ReadResult read(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2080
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::load_key ( T *  k,
bool  check_readable = true 
) const
inlineinherited

(1) deserialize the node's key (necessarily a scalar) to the given variable, forwarding to the user-overrideable read_key() function, which can be for ConstNodeRef (see Read from ConstNodeRef) or for tree+id (see Read from Tree).

This method differs from ConstNodeRef::deserialize_key() in that here the error callback is called if the deserialization failed, or (optionally) the node is not readable.

Definition at line 385 of file node.hpp.

386  {
387  if(check_readable)
388  check_key_();
389  else
390  assert_key_(); // assert otherwise
391  // we can call read_key() directly because we checked
392  // everything (or the caller told us so)
393  // use the adapter ctor to accomodate legacy read_key() implementations
394  const ReadResult result(read_key((ConstImpl const&)*this, k), id_);
395  if C4_UNLIKELY(!result)
396  err_visit_(tree_, result.node, "could not deserialize key");
397  }
ReadResult read_key(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2094
static void err_visit_(Tree const *tree, id_type id, const char *msg)
Definition: node.hpp:615
ReadResult deserialize(T *v) const
(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-...
Definition: node.hpp:428
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::load_key ( Wrapper const &  wrapper,
bool  check_readable = true 
) const
inlineinherited

(2) like (1), but for wrapper tag types such as c4::fmt::base64()

Definition at line 401 of file node.hpp.

402  {
403  RYML_CHECK_TYPE_IS_WRAPPER_LIKE_(Wrapper);
404  if(check_readable)
405  check_key_();
406  else
407  assert_key_(); // assert otherwise
408  // we can call read_key() directly because we checked
409  // everything (or the caller told us so)
410  // use the adapter ctor to accomodate legacy read_key() implementations
411  const ReadResult result(read_key((ConstImpl const&)*this, wrapper), id_);
412  if C4_UNLIKELY(!result)
413  err_visit_(tree_, result.node, "could not deserialize key");
414  }
ReadResult read_key(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2094
static void err_visit_(Tree const *tree, id_type id, const char *msg)
Definition: node.hpp:615
ReadResult deserialize(T *v) const
(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-...
Definition: node.hpp:428
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize ( T *  v) const
inlineinherited

(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-overrideable read() function (see Read from ConstNodeRef).

Returns
a ReadResult with the deserialization status.

Definition at line 428 of file node.hpp.

429  {
430  assert_val_();
431  // use the adapter ctor to accomodate legacy read() implementations
432  return ReadResult(read((ConstImpl const&)*this, v), id_);
433  }
ReadResult read(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2080
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize ( Wrapper const &  wrapper) const
inlineinherited

(2) like (1), but for wrapper tag types such as c4::fmt::base64()

Definition at line 437 of file node.hpp.

438  {
439  RYML_CHECK_TYPE_IS_WRAPPER_LIKE_(Wrapper);
440  assert_val_();
441  // use the adapter ctor to accomodate legacy read() implementations
442  return ReadResult(read((ConstImpl const&)*this, wrapper), id_);
443  }
ReadResult read(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2080
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_key ( T *  v) const
inlineinherited

(1) deserialize the node's key (necessarily a scalar) to the given variable, forwarding to the user-overrideable read_key() function (see Read from ConstNodeRef).

Returns
a ReadResult with the deserialization status.

Definition at line 451 of file node.hpp.

452  {
453  assert_key_();
454  // use the adapter ctor to accomodate legacy read_key() implementations
455  return ReadResult(read_key((ConstImpl const&)*this, v), id_);
456  }
ReadResult read_key(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2094
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_key ( Wrapper const &  wrapper) const
inlineinherited

(2) like (1), but for wrapper tag types such as c4::fmt::base64()

Definition at line 460 of file node.hpp.

461  {
462  RYML_CHECK_TYPE_IS_WRAPPER_LIKE_(Wrapper);
463  assert_key_();
464  // use the adapter ctor to accomodate legacy read_key() implementations
465  return ReadResult(read_key((ConstImpl const&)*this, wrapper), id_);
466  }
ReadResult read_key(ConstNodeRef const &n, T const &wrapper)
Definition: node.hpp:2094
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_child ( csubstr  child_key,
T *  v 
) const
inlineinherited

(1) find a child by name and deserialize its contents to the given variable (ie call .deserialize() on the child if it exists).

Otherwise, the variable is kept unchanged.

Returns
a ReadResult set with this node's id if no child exists, or the ReadResult from the deserialization.
See also
see also ConstNodeRef::find_child_r()

Definition at line 485 of file node.hpp.

486  {
487  this_assert_readable_();
488  ConstImpl ch;
489  ReadResult r = this_->find_child_r(child_key, &ch);
490  if(r)
491  r = ch.deserialize(v);
492  return r;
493  }
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_child ( csubstr  child_key,
T *  v,
T const &  fallback 
) const
inlineinherited

(2) like (1), but assign from fallback if no such child exists.

Definition at line 496 of file node.hpp.

497  {
498  this_assert_readable_();
499  ConstImpl ch;
500  if(this_->find_child_r(child_key, &ch))
501  return ch.deserialize(v);
502  *v = fallback;
503  return ReadResult();
504  }
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_child ( csubstr  child_key,
Wrapper const &  v 
) const
inlineinherited

(3) like (1), but for wrapper tag types such as c4::fmt::base64()

Definition at line 507 of file node.hpp.

508  {
509  this_assert_readable_();
510  ConstImpl ch;
511  ReadResult r = this_->find_child_r(child_key, &ch);
512  if(r)
513  r = ch.deserialize(v);
514  return r;
515  }
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_child ( id_type  child_pos,
T *  v 
) const
inlineinherited

(1) find a child by position and deserialize its contents to the given variable (ie call .deserialize() on the child if it exists).

Otherwise, the variable is kept unchanged.

Returns
a ReadResult set with this node's id if no child exists, or the ReadResult from the deserialization.
See also
see also ConstNodeRef::child_r()

Definition at line 526 of file node.hpp.

527  {
528  this_assert_readable_();
529  ConstImpl ch;
530  ReadResult r = this_->child_r(child_pos, &ch);
531  if(r)
532  r = ch.deserialize(v);
533  return r;
534  }
id_type child_pos(ConstNodeRef const &n) const RYML_NOEXCEPT
O(num_children).
Definition: node.hpp:305
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_child ( id_type  child_pos,
T *  v,
T const &  fallback 
) const
inlineinherited

(2) like (1), but assign from fallback if no such child exists

Definition at line 537 of file node.hpp.

538  {
539  this_assert_readable_();
540  ConstImpl ch;
541  if(this_->child_r(child_pos, &ch))
542  return ch.deserialize(v);
543  *v = fallback;
544  return ReadResult();
545  }
id_type child_pos(ConstNodeRef const &n) const RYML_NOEXCEPT
O(num_children).
Definition: node.hpp:305
ReadResult c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::deserialize_child ( id_type  child_pos,
Wrapper const &  wrapper 
) const
inlineinherited

(3) like (1), but for wrapper tag types such as c4::fmt::base64()

Definition at line 549 of file node.hpp.

550  {
551  this_assert_readable_();
552  ConstImpl ch;
553  ReadResult r = this_->child_r(child_pos, &ch);
554  if(r)
555  r = ch.deserialize(wrapper);
556  return r;
557  }
id_type child_pos(ConstNodeRef const &n) const RYML_NOEXCEPT
O(num_children).
Definition: node.hpp:305
NodeRef const& c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::operator>> ( T &  v) const
inlineinherited

Definition at line 573 of file node.hpp.

573 { load(&v); return (Impl const&)*this; }
void load(T *v, bool check_readable=true) const
(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-...
Definition: node.hpp:345
NodeRef const& c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::operator>> ( T const &  wrapper) const
inlineinherited

Definition at line 577 of file node.hpp.

577 { load(wrapper); return (Impl const&)*this; }
void load(T *v, bool check_readable=true) const
(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-...
Definition: node.hpp:345
NodeRef const& c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::operator>> ( Key< T > const &  v) const
inlineinherited

Definition at line 581 of file node.hpp.

581 { load_key(&v.k); return (Impl const&)*this; }
void load_key(T *k, bool check_readable=true) const
(1) deserialize the node's key (necessarily a scalar) to the given variable, forwarding to the user-o...
Definition: node.hpp:385
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::check_val_ ( ) const
inlineprotectedinherited

Definition at line 589 of file node.hpp.

590  {
591  if C4_UNLIKELY(!tree_)
592  err_basic_("node not readable");
593  else if C4_UNLIKELY(!(((Impl const* C4_RESTRICT)this)->readable()))
594  err_visit_(tree_, id_, "node not readable");
595  else if C4_UNLIKELY(!(tree_->type(id_) & (VAL|MAP|SEQ)))
596  err_visit_(tree_, id_, "node has no contents");
597  }
static void err_visit_(Tree const *tree, id_type id, const char *msg)
Definition: node.hpp:615
a scalar: has a scalar (ie string) value, possibly empty. must be a leaf node, and cannot be MAP or S...
Definition: node_type.hpp:34
a map: a parent of KEYVAL/KEYSEQ/KEYMAP nodes
Definition: node_type.hpp:35
a seq: a parent of VAL/SEQ/MAP nodes
Definition: node_type.hpp:36
NodeType type() const RYML_NOEXCEPT
Forward to Tree::type().
Definition: node.hpp:172
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::check_key_ ( ) const
inlineprotectedinherited

Definition at line 598 of file node.hpp.

599  {
600  if C4_UNLIKELY(!tree_)
601  err_basic_("node not readable");
602  else if C4_UNLIKELY(!(((Impl const* C4_RESTRICT)this)->readable()))
603  err_visit_(tree_, id_, "node not readable");
604  else if C4_UNLIKELY(!(tree_->type(id_) & KEY))
605  err_visit_(tree_, id_, "node has no key");
606  }
static void err_visit_(Tree const *tree, id_type id, const char *msg)
Definition: node.hpp:615
the scalar to the left of : in a map's member
Definition: node_type.hpp:33
NodeType type() const RYML_NOEXCEPT
Forward to Tree::type().
Definition: node.hpp:172
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
static void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::err_basic_ ( const char *  msg)
inlinestaticprotectedinherited

Definition at line 609 of file node.hpp.

610  {
611  RYML_ERR_BASIC_(msg);
612  }
static void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::err_visit_ ( Tree const *  tree,
id_type  id,
const char *  msg 
)
inlinestaticprotectedinherited

Definition at line 615 of file node.hpp.

616  {
617  RYML_ERR_VISIT_CB_(tree->m_callbacks, tree, id, msg);
618  }
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::assert_val_ ( ) const
inlineprotectednoexceptinherited

Definition at line 624 of file node.hpp.

624 {}
void c4::yml::detail::RoNodeMethods< NodeRef , ConstNodeRef >::assert_key_ ( ) const
inlineprotectednoexceptinherited

Definition at line 625 of file node.hpp.

625 {}

Friends And Related Function Documentation

friend struct detail::RoNodeMethods< NodeRef, ConstNodeRef >
friend

Definition at line 1099 of file node.hpp.


The documentation for this class was generated from the following file: