rapidyaml  0.8.0
parse and emit YAML, and do it fast
c4::yml::ConstNodeRef Class Reference

Holds a pointer to an existing tree, and a node id. More...

#include <node.hpp>

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

Public Types

using tree_type = Tree const
 

Public Member Functions

construction
 ConstNodeRef () noexcept
 
 ConstNodeRef (Tree const &t) noexcept
 
 ConstNodeRef (Tree const *t) noexcept
 
 ConstNodeRef (Tree const *t, id_type id) noexcept
 
 ConstNodeRef (std::nullptr_t) noexcept
 
 ConstNodeRef (ConstNodeRef const &) noexcept=default
 
 ConstNodeRef (ConstNodeRef &&) noexcept=default
 
 ConstNodeRef (NodeRef const &) noexcept
 
 ConstNodeRef (NodeRef &&) noexcept
 
assignment
ConstNodeRefoperator= (std::nullptr_t) noexcept
 
ConstNodeRefoperator= (ConstNodeRef const &) noexcept=default
 
ConstNodeRefoperator= (ConstNodeRef &&) noexcept=default
 
ConstNodeRefoperator= (NodeRef const &) noexcept
 
ConstNodeRefoperator= (NodeRef &&) noexcept
 
member getters
Tree const * tree () const noexcept
 
id_type id () const noexcept
 
comparisons
bool operator== (ConstNodeRef const &that) const RYML_NOEXCEPT
 
bool operator!= (ConstNodeRef const &that) const RYML_NOEXCEPT
 
node property getters
NodeData const * get () const RYML_NOEXCEPT
 returns the data or null when the id is NONE More...
 
auto get () RYML_NOEXCEPT -> NodeData *
 returns the data or null when the id is NONE More...
 
NodeType type () const RYML_NOEXCEPT
 Forward to Tree::type_str(). More...
 
const char * type_str () const RYML_NOEXCEPT
 Forward to Tree::type_str(). More...
 
csubstr key () const RYML_NOEXCEPT
 Forward to Tree::key(). More...
 
csubstr key_tag () const RYML_NOEXCEPT
 Forward to Tree::key_tag(). More...
 
csubstr key_ref () const RYML_NOEXCEPT
 Forward to Tree::key_ref(). More...
 
csubstr key_anchor () const RYML_NOEXCEPT
 Forward to Tree::key_anchor(). More...
 
csubstr val () const RYML_NOEXCEPT
 Forward to Tree::val(). More...
 
csubstr val_tag () const RYML_NOEXCEPT
 Forward to Tree::val_tag(). More...
 
csubstr val_ref () const RYML_NOEXCEPT
 Forward to Tree::val_ref(). More...
 
csubstr val_anchor () const RYML_NOEXCEPT
 Forward to Tree::val_anchor(). More...
 
NodeScalar const & keysc () const RYML_NOEXCEPT
 Forward to Tree::keysc(). More...
 
NodeScalar const & valsc () const RYML_NOEXCEPT
 Forward to Tree::valsc(). More...
 
bool key_is_null () const RYML_NOEXCEPT
 Forward to Tree::key_is_null(). More...
 
bool val_is_null () const RYML_NOEXCEPT
 Forward to Tree::val_is_null(). More...
 
bool is_key_unfiltered () const noexcept
 Forward to Tree::is_key_unfiltered(). More...
 
bool is_val_unfiltered () const noexcept
 Forward to Tree::is_val_unfiltered(). More...
 
node type predicates
bool empty () const RYML_NOEXCEPT
 Forward to Tree::empty(). More...
 
bool is_stream () const RYML_NOEXCEPT
 Forward to Tree::is_stream(). More...
 
bool is_doc () const RYML_NOEXCEPT
 Forward to Tree::is_doc(). More...
 
bool is_container () const RYML_NOEXCEPT
 Forward to Tree::is_container(). More...
 
bool is_map () const RYML_NOEXCEPT
 Forward to Tree::is_map(). More...
 
bool is_seq () const RYML_NOEXCEPT
 Forward to Tree::is_seq(). More...
 
bool has_val () const RYML_NOEXCEPT
 Forward to Tree::has_val(). More...
 
bool has_key () const RYML_NOEXCEPT
 Forward to Tree::has_key(). More...
 
bool is_val () const RYML_NOEXCEPT
 Forward to Tree::is_val(). More...
 
bool is_keyval () const RYML_NOEXCEPT
 Forward to Tree::is_keyval(). More...
 
bool has_key_tag () const RYML_NOEXCEPT
 Forward to Tree::has_key_tag(). More...
 
bool has_val_tag () const RYML_NOEXCEPT
 Forward to Tree::has_val_tag(). More...
 
bool has_key_anchor () const RYML_NOEXCEPT
 Forward to Tree::has_key_anchor(). More...
 
bool has_val_anchor () const RYML_NOEXCEPT
 Forward to Tree::has_val_anchor(). More...
 
bool has_anchor () const RYML_NOEXCEPT
 Forward to Tree::has_anchor(). More...
 
bool is_key_ref () const RYML_NOEXCEPT
 Forward to Tree::is_key_ref(). More...
 
bool is_val_ref () const RYML_NOEXCEPT
 Forward to Tree::is_val_ref(). More...
 
bool is_ref () const RYML_NOEXCEPT
 Forward to Tree::is_ref(). More...
 
bool parent_is_seq () const RYML_NOEXCEPT
 Forward to Tree::parent_is_seq(). More...
 
bool parent_is_map () const RYML_NOEXCEPT
 Forward to Tree::parent_is_map(). More...
 
bool is_key_anchor () const noexcept
 
bool is_val_hanchor () const noexcept
 
bool is_anchor () const noexcept
 
bool is_anchor_or_ref () const noexcept
 
node container+scalar style predicates
bool type_has_any (NodeType_e bits) const RYML_NOEXCEPT
 Forward to Tree::type_has_any(). More...
 
bool type_has_all (NodeType_e bits) const RYML_NOEXCEPT
 Forward to Tree::type_has_all(). More...
 
bool type_has_none (NodeType_e bits) const RYML_NOEXCEPT
 Forward to Tree::type_has_none(). More...
 
bool is_container_styled () const RYML_NOEXCEPT
 Forward to Tree::is_container_styled(). More...
 
bool is_block () const RYML_NOEXCEPT
 Forward to Tree::is_block(). More...
 
bool is_flow_sl () const RYML_NOEXCEPT
 Forward to Tree::is_flow_sl(). More...
 
bool is_flow_ml () const RYML_NOEXCEPT
 Forward to Tree::is_flow_ml(). More...
 
bool is_flow () const RYML_NOEXCEPT
 Forward to Tree::is_flow(). More...
 
bool is_key_styled () const RYML_NOEXCEPT
 Forward to Tree::is_key_styled(). More...
 
bool is_val_styled () const RYML_NOEXCEPT
 Forward to Tree::is_val_styled(). More...
 
bool is_key_literal () const RYML_NOEXCEPT
 Forward to Tree::is_key_literal(). More...
 
bool is_val_literal () const RYML_NOEXCEPT
 Forward to Tree::is_val_literal(). More...
 
bool is_key_folded () const RYML_NOEXCEPT
 Forward to Tree::is_key_folded(). More...
 
bool is_val_folded () const RYML_NOEXCEPT
 Forward to Tree::is_val_folded(). More...
 
bool is_key_squo () const RYML_NOEXCEPT
 Forward to Tree::is_key_squo(). More...
 
bool is_val_squo () const RYML_NOEXCEPT
 Forward to Tree::is_val_squo(). More...
 
bool is_key_dquo () const RYML_NOEXCEPT
 Forward to Tree::is_key_dquo(). More...
 
bool is_val_dquo () const RYML_NOEXCEPT
 Forward to Tree::is_val_dquo(). More...
 
bool is_key_plain () const RYML_NOEXCEPT
 Forward to Tree::is_key_plain(). More...
 
bool is_val_plain () const RYML_NOEXCEPT
 Forward to Tree::is_val_plain(). More...
 
bool is_key_quoted () const RYML_NOEXCEPT
 Forward to Tree::is_key_quoted(). More...
 
bool is_val_quoted () const RYML_NOEXCEPT
 Forward to Tree::is_val_quoted(). More...
 
bool is_quoted () const RYML_NOEXCEPT
 Forward to Tree::is_quoted(). More...
 
hierarchy predicates
bool is_root () const RYML_NOEXCEPT
 Forward to Tree::is_root(). More...
 
bool has_parent () const RYML_NOEXCEPT
 Forward to Tree::has_parent() Node must be readable. More...
 
bool has_child (ConstNodeRef const &n) const RYML_NOEXCEPT
 Forward to Tree::has_child(). More...
 
bool has_child (id_type node) const RYML_NOEXCEPT
 Forward to Tree::has_child(). More...
 
bool has_child (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::has_child(). More...
 
bool has_children () const RYML_NOEXCEPT
 Forward to Tree::has_child(). More...
 
bool has_sibling (ConstNodeRef const &n) const RYML_NOEXCEPT
 Forward to Tree::has_sibling(). More...
 
bool has_sibling (id_type node) const RYML_NOEXCEPT
 Forward to Tree::has_sibling(). More...
 
bool has_sibling (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::has_sibling(). More...
 
bool has_other_siblings () const RYML_NOEXCEPT
 Forward to Tree::has_sibling(). More...
 
bool has_siblings () const RYML_NOEXCEPT
 
hierarchy getters
auto doc (id_type i) RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::doc(). More...
 
ConstNodeRef doc (id_type i) const RYML_NOEXCEPT
 Forward to Tree::doc(). More...
 
auto parent () RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::parent(). More...
 
ConstNodeRef parent () const RYML_NOEXCEPT
 Forward to Tree::parent(). More...
 
auto first_child () RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::first_child(). More...
 
ConstNodeRef first_child () const RYML_NOEXCEPT
 Forward to Tree::first_child(). More...
 
auto last_child () RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::last_child(). More...
 
ConstNodeRef last_child () const RYML_NOEXCEPT
 Forward to Tree::last_child(). More...
 
auto child (id_type pos) RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::child(). More...
 
ConstNodeRef child (id_type pos) const RYML_NOEXCEPT
 Forward to Tree::child(). More...
 
auto find_child (csubstr name) RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::first_child(). More...
 
ConstNodeRef find_child (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::first_child(). More...
 
auto prev_sibling () RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::prev_sibling(). More...
 
ConstNodeRef prev_sibling () const RYML_NOEXCEPT
 Forward to Tree::prev_sibling(). More...
 
auto next_sibling () RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::next_sibling(). More...
 
ConstNodeRef next_sibling () const RYML_NOEXCEPT
 Forward to Tree::next_sibling(). More...
 
auto first_sibling () RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::first_sibling(). More...
 
ConstNodeRef first_sibling () const RYML_NOEXCEPT
 Forward to Tree::first_sibling(). More...
 
auto last_sibling () RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::last_sibling(). More...
 
ConstNodeRef last_sibling () const RYML_NOEXCEPT
 Forward to Tree::last_sibling(). More...
 
auto sibling (id_type pos) RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::sibling(). More...
 
ConstNodeRef sibling (id_type pos) const RYML_NOEXCEPT
 Forward to Tree::sibling(). More...
 
auto find_sibling (csubstr name) RYML_NOEXCEPT -> ConstNodeRef
 Forward to Tree::find_sibling(). More...
 
ConstNodeRef find_sibling (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::find_sibling(). More...
 
id_type num_children () const RYML_NOEXCEPT
 O(num_children). More...
 
id_type num_siblings () const RYML_NOEXCEPT
 O(num_children). More...
 
id_type num_other_siblings () const RYML_NOEXCEPT
 O(num_siblings). More...
 
id_type child_pos (ConstNodeRef const &n) const RYML_NOEXCEPT
 O(num_children). More...
 
id_type sibling_pos (ConstNodeRef const &n) const RYML_NOEXCEPT
 O(num_siblings). More...
 
id_type depth_asc () const RYML_NOEXCEPT
 
id_type depth_desc () const RYML_NOEXCEPT
 O(log(num_nodes)). More...
 
square_brackets

O(num_nodes).

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

operator[]

auto operator[] (csubstr key) RYML_NOEXCEPT -> ConstNodeRef
 Find child by key; complexity is O(num_children). More...
 
auto operator[] (id_type pos) RYML_NOEXCEPT -> ConstNodeRef
 Find child by position; complexity is O(pos). More...
 
ConstNodeRef operator[] (csubstr key) const RYML_NOEXCEPT
 Find a child by key; complexity is O(num_children). More...
 
ConstNodeRef operator[] (id_type pos) const RYML_NOEXCEPT
 Find a child by position; complexity is O(pos). More...
 
at

These functions are the analogue to operator[], with the difference that they emit an error instead of an assertion.

That is, if any of the pre or post conditions is violated, an error is always emitted (resulting in a call to the error callback).

auto at (csubstr key) -> ConstNodeRef
 Find child by key; complexity is O(num_children). More...
 
auto at (id_type pos) -> ConstNodeRef
 Find child by position; complexity is O(pos). More...
 
ConstNodeRef at (csubstr key) const
 Get a child by name, with error checking; complexity is O(num_children). More...
 
ConstNodeRef at (id_type pos) const
 Get a child by position, with error checking; complexity is O(pos). More...
 
deserialization
ConstNodeRef const & operator>> (T &v) const
 deserialize the node's val to the given variable, forwarding to the user-overrideable read() function. More...
 
ConstNodeRef const & operator>> (Key< T > v) const
 deserialize the node's key to the given variable, forwarding to the user-overrideable read() function; use key() to disambiguate; for example: node >> ryml::key(var) More...
 
bool get_if (csubstr name, T *var) const
 look for a child by name, if it exists assign to var. More...
 
bool get_if (csubstr name, T *var, T const &fallback) const
 look for a child by name, if it exists assign to var, otherwise default to fallback. More...
 
deserialization_base64
ConstNodeRef const & operator>> (Key< fmt::base64_wrapper > w) const
 deserialize the node's key as base64. More...
 
ConstNodeRef const & operator>> (fmt::base64_wrapper w) const
 deserialize the node's val as base64. More...
 
size_t deserialize_key (fmt::base64_wrapper v) const
 decode the base64-encoded key and assign the decoded blob to the given buffer/ More...
 
size_t deserialize_val (fmt::base64_wrapper v) const
 decode the base64-encoded key and assign the decoded blob to the given buffer/ More...
 

Public Attributes

Tree const * m_tree
 
id_type m_id
 
friend NodeRef
 

Friends

struct detail::RoNodeMethods< ConstNodeRef, ConstNodeRef >
 

iteration

using iterator = detail::child_iterator< ConstNodeRef >
 
using const_iterator = detail::child_iterator< ConstNodeRef >
 
using children_view = detail::children_view_< ConstNodeRef >
 
using const_children_view = detail::children_view_< ConstNodeRef >
 
auto begin () RYML_NOEXCEPT -> iterator
 get an iterator to the first child More...
 
const_iterator begin () const RYML_NOEXCEPT
 get an iterator to the first child More...
 
const_iterator cbegin () const RYML_NOEXCEPT
 get an iterator to the first child More...
 
auto end () RYML_NOEXCEPT -> iterator
 get an iterator to after the last child More...
 
const_iterator end () const RYML_NOEXCEPT
 get an iterator to after the last child More...
 
const_iterator cend () const RYML_NOEXCEPT
 get an iterator to after the last child More...
 
auto children () RYML_NOEXCEPT -> children_view
 get an iterable view over children More...
 
const_children_view children () const RYML_NOEXCEPT
 get an iterable view over children More...
 
const_children_view cchildren () const RYML_NOEXCEPT
 get an iterable view over children More...
 
auto siblings () RYML_NOEXCEPT -> children_view
 get an iterable view over all siblings (including the calling node) More...
 
const_children_view siblings () const RYML_NOEXCEPT
 get an iterable view over all siblings (including the calling node) More...
 
const_children_view csiblings () const RYML_NOEXCEPT
 get an iterable view over all siblings (including the calling node) More...
 
bool visit (Visitor fn, id_type indentation_level=0, bool skip_root=true) const RYML_NOEXCEPT
 visit every child node calling fn(node) More...
 
auto visit (Visitor fn, id_type indentation_level=0, bool skip_root=true) RYML_NOEXCEPT -> bool
 visit every child node calling fn(node) More...
 
bool visit_stacked (Visitor fn, id_type indentation_level=0, bool skip_root=true) const RYML_NOEXCEPT
 visit every child node calling fn(node, level) More...
 
auto visit_stacked (Visitor fn, id_type indentation_level=0, bool skip_root=true) RYML_NOEXCEPT -> bool
 visit every child node calling fn(node, level) More...
 

state queries

see NodeRef for an explanation on what these states mean

bool invalid () const noexcept
 
bool readable () const noexcept
 because a ConstNodeRef cannot be used to write to the tree, readable() has the same meaning as !invalid() More...
 
bool valid () const noexcept
 
constexpr static bool is_seed () noexcept
 because a ConstNodeRef cannot be used to write to the tree, it can never be a seed. More...
 

Detailed Description

Holds a pointer to an existing tree, and a node id.

It can be used only 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 837 of file node.hpp.

Member Typedef Documentation

◆ tree_type

Definition at line 841 of file node.hpp.

◆ iterator

using c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::iterator = detail::child_iterator<ConstNodeRef >
inherited

Definition at line 724 of file node.hpp.

◆ const_iterator

using c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::const_iterator = detail::child_iterator<ConstNodeRef >
inherited

Definition at line 725 of file node.hpp.

◆ children_view

using c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::children_view = detail::children_view_<ConstNodeRef >
inherited

Definition at line 726 of file node.hpp.

◆ const_children_view

Definition at line 727 of file node.hpp.

Constructor & Destructor Documentation

◆ ConstNodeRef() [1/7]

c4::yml::ConstNodeRef::ConstNodeRef ( )
inlinenoexcept

Definition at line 856 of file node.hpp.

856 : m_tree(nullptr), m_id(NONE) {}
Tree const * m_tree
Definition: node.hpp:845
@ NONE
an index to none
Definition: common.hpp:260

◆ ConstNodeRef() [2/7]

c4::yml::ConstNodeRef::ConstNodeRef ( Tree const &  t)
inlinenoexcept

Definition at line 857 of file node.hpp.

857 : m_tree(&t), m_id(t .root_id()) {}

◆ ConstNodeRef() [3/7]

c4::yml::ConstNodeRef::ConstNodeRef ( Tree const *  t)
inlinenoexcept

Definition at line 858 of file node.hpp.

858 : m_tree(t ), m_id(t->root_id()) {}

◆ ConstNodeRef() [4/7]

c4::yml::ConstNodeRef::ConstNodeRef ( Tree const *  t,
id_type  id 
)
inlinenoexcept

Definition at line 859 of file node.hpp.

859 : m_tree(t), m_id(id) {}

◆ ConstNodeRef() [5/7]

c4::yml::ConstNodeRef::ConstNodeRef ( std::nullptr_t  )
inlinenoexcept

Definition at line 860 of file node.hpp.

860 : m_tree(nullptr), m_id(NONE) {}

◆ ConstNodeRef() [6/7]

c4::yml::ConstNodeRef::ConstNodeRef ( ConstNodeRef const &  )
defaultnoexcept

◆ ConstNodeRef() [7/7]

c4::yml::ConstNodeRef::ConstNodeRef ( ConstNodeRef &&  )
defaultnoexcept

Member Function Documentation

◆ operator=() [1/3]

ConstNodeRef& c4::yml::ConstNodeRef::operator= ( std::nullptr_t  )
inlinenoexcept

Definition at line 875 of file node.hpp.

875 { m_tree = nullptr; m_id = NONE; return *this; }

References c4::yml::NONE.

◆ operator=() [2/3]

ConstNodeRef& c4::yml::ConstNodeRef::operator= ( ConstNodeRef const &  )
defaultnoexcept

◆ operator=() [3/3]

ConstNodeRef& c4::yml::ConstNodeRef::operator= ( ConstNodeRef &&  )
defaultnoexcept

◆ invalid()

bool c4::yml::ConstNodeRef::invalid ( ) const
inlinenoexcept

Definition at line 893 of file node.hpp.

893 { return (!m_tree) || (m_id == NONE); }

References c4::yml::NONE.

Referenced by sample::sample_quick_overview().

◆ readable()

bool c4::yml::ConstNodeRef::readable ( ) const
inlinenoexcept

because a ConstNodeRef cannot be used to write to the tree, readable() has the same meaning as !invalid()

Definition at line 896 of file node.hpp.

896 { return m_tree != nullptr && m_id != NONE; }

References c4::yml::NONE.

Referenced by c4::yml::Emitter< Writer >::emit_as(), c4::yml::emitrs_json(), c4::yml::emitrs_yaml(), and sample::sample_quick_overview().

◆ is_seed()

constexpr static bool c4::yml::ConstNodeRef::is_seed ( )
inlinestaticconstexprnoexcept

because a ConstNodeRef cannot be used to write to the tree, it can never be a seed.

This method is provided for API equivalence between ConstNodeRef and NodeRef.

Definition at line 899 of file node.hpp.

899 { return false; }

◆ valid()

bool c4::yml::ConstNodeRef::valid ( ) const
inlinenoexcept

Definition at line 901 of file node.hpp.

901 { return m_tree != nullptr && m_id != NONE; }

References c4::yml::NONE.

◆ tree()

Tree const* c4::yml::ConstNodeRef::tree ( ) const
inlinenoexcept

◆ id()

id_type c4::yml::ConstNodeRef::id ( ) const
inlinenoexcept

◆ operator==()

bool c4::yml::ConstNodeRef::operator== ( ConstNodeRef const &  that) const
inline

Definition at line 920 of file node.hpp.

920 { return that.m_tree == m_tree && m_id == that.m_id; }

◆ operator!=()

bool c4::yml::ConstNodeRef::operator!= ( ConstNodeRef const &  that) const
inline

Definition at line 921 of file node.hpp.

921 { return ! this->operator== (that); }
bool operator==(ConstNodeRef const &that) const RYML_NOEXCEPT
Definition: node.hpp:920

References c4::operator==().

◆ get() [1/2]

NodeData const* c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::get ( ) const
inlineinherited

returns the data or null when the id is NONE

Definition at line 199 of file node.hpp.

199 { return ((Impl const*)this)->readable() ? tree_->get(id_) : nullptr; }

◆ get() [2/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::get ( ) -> NodeData*
inlineinherited

returns the data or null when the id is NONE

Definition at line 202 of file node.hpp.

202 { return ((Impl const*)this)->readable() ? tree__->get(id__) : nullptr; }

◆ type()

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

Forward to Tree::type_str().

Node must be readable.

Definition at line 204 of file node.hpp.

◆ type_str()

const char* c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::type_str ( ) const
inlineinherited

Forward to Tree::type_str().

Node must be readable.

Definition at line 205 of file node.hpp.

◆ key()

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

Forward to Tree::key().

Node must be readable.

Definition at line 207 of file node.hpp.

◆ key_tag()

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

Forward to Tree::key_tag().

Node must be readable.

Definition at line 208 of file node.hpp.

◆ key_ref()

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

Forward to Tree::key_ref().

Node must be readable.

Definition at line 209 of file node.hpp.

◆ key_anchor()

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

Forward to Tree::key_anchor().

Node must be readable.

Definition at line 210 of file node.hpp.

◆ val()

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

Forward to Tree::val().

Node must be readable.

Definition at line 212 of file node.hpp.

◆ val_tag()

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

Forward to Tree::val_tag().

Node must be readable.

Definition at line 213 of file node.hpp.

◆ val_ref()

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

Forward to Tree::val_ref().

Node must be readable.

Definition at line 214 of file node.hpp.

◆ val_anchor()

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

Forward to Tree::val_anchor().

Node must be readable.

Definition at line 215 of file node.hpp.

◆ keysc()

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

Forward to Tree::keysc().

Node must be readable.

Definition at line 217 of file node.hpp.

◆ valsc()

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

Forward to Tree::valsc().

Node must be readable.

Definition at line 218 of file node.hpp.

◆ key_is_null()

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

Forward to Tree::key_is_null().

Node must be readable.

Definition at line 220 of file node.hpp.

◆ val_is_null()

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

Forward to Tree::val_is_null().

Node must be readable.

Definition at line 221 of file node.hpp.

◆ is_key_unfiltered()

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

Forward to Tree::is_key_unfiltered().

Node must be readable.

Definition at line 223 of file node.hpp.

◆ is_val_unfiltered()

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

Forward to Tree::is_val_unfiltered().

Node must be readable.

Definition at line 224 of file node.hpp.

◆ empty()

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

Forward to Tree::empty().

Node must be readable.

Definition at line 233 of file node.hpp.

◆ is_stream()

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

Forward to Tree::is_stream().

Node must be readable.

Definition at line 234 of file node.hpp.

◆ is_doc()

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

Forward to Tree::is_doc().

Node must be readable.

Definition at line 235 of file node.hpp.

◆ is_container()

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

Forward to Tree::is_container().

Node must be readable.

Definition at line 236 of file node.hpp.

◆ is_map()

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

Forward to Tree::is_map().

Node must be readable.

Definition at line 237 of file node.hpp.

◆ is_seq()

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

Forward to Tree::is_seq().

Node must be readable.

Definition at line 238 of file node.hpp.

◆ has_val()

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

Forward to Tree::has_val().

Node must be readable.

Definition at line 239 of file node.hpp.

◆ has_key()

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

Forward to Tree::has_key().

Node must be readable.

Definition at line 240 of file node.hpp.

◆ is_val()

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

Forward to Tree::is_val().

Node must be readable.

Definition at line 241 of file node.hpp.

◆ is_keyval()

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

Forward to Tree::is_keyval().

Node must be readable.

Definition at line 242 of file node.hpp.

◆ has_key_tag()

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

Forward to Tree::has_key_tag().

Node must be readable.

Definition at line 243 of file node.hpp.

◆ has_val_tag()

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

Forward to Tree::has_val_tag().

Node must be readable.

Definition at line 244 of file node.hpp.

◆ has_key_anchor()

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

Forward to Tree::has_key_anchor().

Node must be readable.

Definition at line 245 of file node.hpp.

◆ has_val_anchor()

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

Forward to Tree::has_val_anchor().

Node must be readable.

Definition at line 246 of file node.hpp.

◆ has_anchor()

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

Forward to Tree::has_anchor().

Node must be readable.

Definition at line 247 of file node.hpp.

◆ is_key_ref()

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

Forward to Tree::is_key_ref().

Node must be readable.

Definition at line 248 of file node.hpp.

◆ is_val_ref()

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

Forward to Tree::is_val_ref().

Node must be readable.

Definition at line 249 of file node.hpp.

◆ is_ref()

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

Forward to Tree::is_ref().

Node must be readable.

Definition at line 250 of file node.hpp.

◆ parent_is_seq()

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

Forward to Tree::parent_is_seq().

Node must be readable.

Definition at line 251 of file node.hpp.

◆ parent_is_map()

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

Forward to Tree::parent_is_map().

Node must be readable.

Definition at line 252 of file node.hpp.

◆ is_key_anchor()

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

Definition at line 254 of file node.hpp.

254 { _C4RR(); return tree_->has_key_anchor(id_); }
#define _C4RR()
Definition: node.hpp:1006

◆ is_val_hanchor()

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

Definition at line 255 of file node.hpp.

255 { _C4RR(); return tree_->has_val_anchor(id_); }

◆ is_anchor()

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

Definition at line 256 of file node.hpp.

256 { _C4RR(); return tree_->has_anchor(id_); }

◆ is_anchor_or_ref()

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

Definition at line 257 of file node.hpp.

257 { _C4RR(); return tree_->is_anchor_or_ref(id_); }

◆ type_has_any()

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

Forward to Tree::type_has_any().

Node must be readable.

Definition at line 268 of file node.hpp.

◆ type_has_all()

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

Forward to Tree::type_has_all().

Node must be readable.

Definition at line 269 of file node.hpp.

◆ type_has_none()

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

Forward to Tree::type_has_none().

Node must be readable.

Definition at line 270 of file node.hpp.

◆ is_container_styled()

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

Forward to Tree::is_container_styled().

Node must be readable.

Definition at line 272 of file node.hpp.

◆ is_block()

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

Forward to Tree::is_block().

Node must be readable.

Definition at line 273 of file node.hpp.

◆ is_flow_sl()

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

Forward to Tree::is_flow_sl().

Node must be readable.

Definition at line 274 of file node.hpp.

◆ is_flow_ml()

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

Forward to Tree::is_flow_ml().

Node must be readable.

Definition at line 275 of file node.hpp.

◆ is_flow()

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

Forward to Tree::is_flow().

Node must be readable.

Definition at line 276 of file node.hpp.

◆ is_key_styled()

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

Forward to Tree::is_key_styled().

Node must be readable.

Definition at line 278 of file node.hpp.

◆ is_val_styled()

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

Forward to Tree::is_val_styled().

Node must be readable.

Definition at line 279 of file node.hpp.

◆ is_key_literal()

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

Forward to Tree::is_key_literal().

Node must be readable.

Definition at line 280 of file node.hpp.

◆ is_val_literal()

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

Forward to Tree::is_val_literal().

Node must be readable.

Definition at line 281 of file node.hpp.

◆ is_key_folded()

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

Forward to Tree::is_key_folded().

Node must be readable.

Definition at line 282 of file node.hpp.

◆ is_val_folded()

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

Forward to Tree::is_val_folded().

Node must be readable.

Definition at line 283 of file node.hpp.

◆ is_key_squo()

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

Forward to Tree::is_key_squo().

Node must be readable.

Definition at line 284 of file node.hpp.

◆ is_val_squo()

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

Forward to Tree::is_val_squo().

Node must be readable.

Definition at line 285 of file node.hpp.

◆ is_key_dquo()

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

Forward to Tree::is_key_dquo().

Node must be readable.

Definition at line 286 of file node.hpp.

◆ is_val_dquo()

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

Forward to Tree::is_val_dquo().

Node must be readable.

Definition at line 287 of file node.hpp.

◆ is_key_plain()

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

Forward to Tree::is_key_plain().

Node must be readable.

Definition at line 288 of file node.hpp.

◆ is_val_plain()

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

Forward to Tree::is_val_plain().

Node must be readable.

Definition at line 289 of file node.hpp.

◆ is_key_quoted()

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

Forward to Tree::is_key_quoted().

Node must be readable.

Definition at line 290 of file node.hpp.

◆ is_val_quoted()

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

Forward to Tree::is_val_quoted().

Node must be readable.

Definition at line 291 of file node.hpp.

◆ is_quoted()

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

Forward to Tree::is_quoted().

Node must be readable.

Definition at line 292 of file node.hpp.

◆ is_root()

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

Forward to Tree::is_root().

Node must be readable.

Definition at line 303 of file node.hpp.

◆ has_parent()

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

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

Definition at line 304 of file node.hpp.

◆ has_child() [1/3]

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

Forward to Tree::has_child().

Node must be readable.

Definition at line 306 of file node.hpp.

◆ has_child() [2/3]

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

Forward to Tree::has_child().

Node must be readable.

Definition at line 307 of file node.hpp.

◆ has_child() [3/3]

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

Forward to Tree::has_child().

Node must be readable.

Definition at line 308 of file node.hpp.

◆ has_children()

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

Forward to Tree::has_child().

Node must be readable.

Definition at line 309 of file node.hpp.

◆ has_sibling() [1/3]

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

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 311 of file node.hpp.

◆ has_sibling() [2/3]

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

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 312 of file node.hpp.

◆ has_sibling() [3/3]

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

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 313 of file node.hpp.

◆ has_other_siblings()

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

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 314 of file node.hpp.

◆ has_siblings()

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

Definition at line 316 of file node.hpp.

316 { _C4RR(); return tree_->has_siblings(id_); }

◆ doc() [1/2]

Forward to Tree::doc().

Node must be readable.

Definition at line 328 of file node.hpp.

◆ doc() [2/2]

Forward to Tree::doc().

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

Definition at line 329 of file node.hpp.

◆ parent() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::parent ( ) -> Impl
inlineinherited

Forward to Tree::parent().

Node must be readable.

Definition at line 332 of file node.hpp.

◆ parent() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::parent ( ) const
inlineinherited

Forward to Tree::parent().

Node must be readable.

Definition at line 333 of file node.hpp.

◆ first_child() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::first_child ( ) -> Impl
inlineinherited

Forward to Tree::first_child().

Node must be readable.

Definition at line 336 of file node.hpp.

◆ first_child() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::first_child ( ) const
inlineinherited

Forward to Tree::first_child().

Node must be readable.

Definition at line 337 of file node.hpp.

◆ last_child() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::last_child ( ) -> Impl
inlineinherited

Forward to Tree::last_child().

Node must be readable.

Definition at line 340 of file node.hpp.

◆ last_child() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::last_child ( ) const
inlineinherited

Forward to Tree::last_child().

Node must be readable.

Definition at line 341 of file node.hpp.

◆ child() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::child ( id_type  pos) -> ConstNodeRef
inlineinherited

Forward to Tree::child().

Node must be readable.

Definition at line 344 of file node.hpp.

◆ child() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::child ( id_type  pos) const
inlineinherited

Forward to Tree::child().

Node must be readable.

Definition at line 345 of file node.hpp.

◆ find_child() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::find_child ( csubstr  name) -> ConstNodeRef
inlineinherited

Forward to Tree::first_child().

Node must be readable.

Definition at line 348 of file node.hpp.

◆ find_child() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::find_child ( csubstr  name) const
inlineinherited

Forward to Tree::first_child().

Node must be readable.

Definition at line 349 of file node.hpp.

◆ prev_sibling() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::prev_sibling ( ) -> Impl
inlineinherited

Forward to Tree::prev_sibling().

Node must be readable.

Definition at line 352 of file node.hpp.

◆ prev_sibling() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::prev_sibling ( ) const
inlineinherited

Forward to Tree::prev_sibling().

Node must be readable.

Definition at line 353 of file node.hpp.

◆ next_sibling() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::next_sibling ( ) -> Impl
inlineinherited

Forward to Tree::next_sibling().

Node must be readable.

Definition at line 356 of file node.hpp.

◆ next_sibling() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::next_sibling ( ) const
inlineinherited

Forward to Tree::next_sibling().

Node must be readable.

Definition at line 357 of file node.hpp.

◆ first_sibling() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::first_sibling ( ) -> Impl
inlineinherited

Forward to Tree::first_sibling().

Node must be readable.

Definition at line 360 of file node.hpp.

◆ first_sibling() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::first_sibling ( ) const
inlineinherited

Forward to Tree::first_sibling().

Node must be readable.

Definition at line 361 of file node.hpp.

◆ last_sibling() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::last_sibling ( ) -> Impl
inlineinherited

Forward to Tree::last_sibling().

Node must be readable.

Definition at line 364 of file node.hpp.

◆ last_sibling() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::last_sibling ( ) const
inlineinherited

Forward to Tree::last_sibling().

Node must be readable.

Definition at line 365 of file node.hpp.

◆ sibling() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::sibling ( id_type  pos) -> ConstNodeRef
inlineinherited

Forward to Tree::sibling().

Node must be readable.

Definition at line 368 of file node.hpp.

◆ sibling() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::sibling ( id_type  pos) const
inlineinherited

Forward to Tree::sibling().

Node must be readable.

Definition at line 369 of file node.hpp.

◆ find_sibling() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::find_sibling ( csubstr  name) -> ConstNodeRef
inlineinherited

Forward to Tree::find_sibling().

Node must be readable.

Definition at line 372 of file node.hpp.

◆ find_sibling() [2/2]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::find_sibling ( csubstr  name) const
inlineinherited

Forward to Tree::find_sibling().

Node must be readable.

Definition at line 373 of file node.hpp.

◆ num_children()

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

O(num_children).

Forward to Tree::num_children().

Definition at line 375 of file node.hpp.

◆ num_siblings()

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

O(num_children).

Forward to Tree::num_siblings().

Definition at line 376 of file node.hpp.

◆ num_other_siblings()

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

O(num_siblings).

Forward to Tree::num_other_siblings().

Definition at line 377 of file node.hpp.

◆ child_pos()

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

O(num_children).

Forward to Tree::child_pos().

Definition at line 378 of file node.hpp.

◆ sibling_pos()

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

O(num_siblings).

Forward to Tree::sibling_pos().

Definition at line 379 of file node.hpp.

◆ depth_asc()

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

Definition at line 381 of file node.hpp.

381 { _C4RR(); return tree_->depth_asc(id_); } /** O(log(num_nodes)). Forward to Tree::depth_asc(). Node must be readable. */

◆ depth_desc()

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

O(log(num_nodes)).

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

Definition at line 382 of file node.hpp.

382 { _C4RR(); return tree_->depth_desc(id_); } /** O(num_nodes). Forward to Tree::depth_desc(). Node must be readable. */

◆ operator[]() [1/4]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator[] ( csubstr  key) -> ConstNodeRef
inlineinherited

Find child by key; complexity is O(num_children).

Returns the requested node, or an object in seed state if no such child is found (see NodeRef for an explanation of what is seed state). When the object is in seed state, using it to read from the tree is UB. The seed node can be used to write to the tree provided that its create() method is called prior to writing, which happens in most modifying methods in NodeRef. It is the caller's responsibility to verify that the returned node is readable before subsequently using it to read from the tree.

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

412  {
413  _C4RR();
414  id_type ch = tree__->find_child(id__, key);
415  return ch != NONE ? Impl(tree__, ch) : Impl(tree__, id__, key);
416  }
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:253
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:207

◆ operator[]() [2/4]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator[] ( id_type  pos) -> ConstNodeRef
inlineinherited

Find child by position; complexity is O(pos).

Returns the requested node, or an object in seed state if no such child is found (see NodeRef for an explanation of what is seed state). When the object is in seed state, using it to read from the tree is UB. The seed node can be used to write to the tree provided that its create() method is called prior to writing, which happens in most modifying methods in NodeRef. It is the caller's responsibility to verify that the returned node is readable before subsequently using it to read from the tree.

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

438  {
439  _C4RR();
440  id_type ch = tree__->child(id__, pos);
441  return ch != NONE ? Impl(tree__, ch) : Impl(tree__, id__, pos);
442  }

◆ operator[]() [3/4]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator[] ( csubstr  key) const
inlineinherited

Find a child by key; complexity is O(num_children).

Behaves similar to the non-const overload, but further asserts that the returned node is readable (because it can never be in a seed state). The assertion is performed only if RYML_USE_ASSERT is set to true. As with the non-const overload, it is UB to use the return value if it is not valid.

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

Definition at line 453 of file node.hpp.

454  {
455  _C4RR();
456  id_type ch = tree_->find_child(id_, key);
457  _RYML_CB_ASSERT(tree_->m_callbacks, ch != NONE);
458  return {tree_, ch};
459  }

◆ operator[]() [4/4]

ConstNodeRef c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator[] ( id_type  pos) const
inlineinherited

Find a child by position; complexity is O(pos).

Behaves similar to the non-const overload, but further asserts that the returned node is readable (because it can never be in a seed state). This assertion is performed only if RYML_USE_ASSERT is set to true. As with the non-const overload, it is UB to use the return value if it is not valid.

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

Definition at line 470 of file node.hpp.

471  {
472  _C4RR();
473  id_type ch = tree_->child(id_, pos);
474  _RYML_CB_ASSERT(tree_->m_callbacks, ch != NONE);
475  return {tree_, ch};
476  }

◆ at() [1/4]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::at ( csubstr  key) -> ConstNodeRef
inlineinherited

Find child by key; complexity is O(num_children).

Returns the requested node, or an object in seed state if no such child is found (see NodeRef for an explanation of what is seed state). When the object is in seed state, using it to read from the tree is UB. The seed node can be subsequently used to write to the tree provided that its create() method is called prior to writing, which happens inside most mutating methods in NodeRef. It is the caller's responsibility to verify that the returned node is readable before subsequently using it to read from the tree.

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

519  {
520  RYML_CHECK(tree_ != nullptr);
521  _RYML_CB_CHECK(tree_->m_callbacks, (id_ >= 0 && id_ < tree_->capacity()));
522  _RYML_CB_CHECK(tree_->m_callbacks, ((Impl const*)this)->readable());
523  _RYML_CB_CHECK(tree_->m_callbacks, tree_->is_map(id_));
524  id_type ch = tree__->find_child(id__, key);
525  return ch != NONE ? Impl(tree__, ch) : Impl(tree__, id__, key);
526  }

◆ at() [2/4]

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

555  {
556  RYML_CHECK(tree_ != nullptr);
557  const id_type cap = tree_->capacity();
558  _RYML_CB_CHECK(tree_->m_callbacks, (id_ >= 0 && id_ < cap));
559  _RYML_CB_CHECK(tree_->m_callbacks, (pos >= 0 && pos < cap));
560  _RYML_CB_CHECK(tree_->m_callbacks, ((Impl const*)this)->readable());
561  _RYML_CB_CHECK(tree_->m_callbacks, tree_->is_container(id_));
562  id_type ch = tree__->child(id__, pos);
563  return ch != NONE ? Impl(tree__, ch) : Impl(tree__, id__, pos);
564  }

◆ at() [3/4]

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

Get a child by name, with error checking; complexity is O(num_children).

Behaves as operator[](csubstr) const, but always raises an error (even when RYML_USE_ASSERT is set to false) when the returned node does not exist, or when this node is not readable, or when it is not a map. This behaviour is similar to std::vector::at(), but the error consists in calling the error callback instead of directly raising an exception.

Definition at line 575 of file node.hpp.

576  {
577  RYML_CHECK(tree_ != nullptr);
578  _RYML_CB_CHECK(tree_->m_callbacks, (id_ >= 0 && id_ < tree_->capacity()));
579  _RYML_CB_CHECK(tree_->m_callbacks, ((Impl const*)this)->readable());
580  _RYML_CB_CHECK(tree_->m_callbacks, tree_->is_map(id_));
581  id_type ch = tree_->find_child(id_, key);
582  _RYML_CB_CHECK(tree_->m_callbacks, ch != NONE);
583  return {tree_, ch};
584  }

◆ at() [4/4]

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

596  {
597  RYML_CHECK(tree_ != nullptr);
598  const id_type cap = tree_->capacity();
599  _RYML_CB_CHECK(tree_->m_callbacks, (id_ >= 0 && id_ < cap));
600  _RYML_CB_CHECK(tree_->m_callbacks, (pos >= 0 && pos < cap));
601  _RYML_CB_CHECK(tree_->m_callbacks, ((Impl const*)this)->readable());
602  _RYML_CB_CHECK(tree_->m_callbacks, tree_->is_container(id_));
603  const id_type ch = tree_->child(id_, pos);
604  _RYML_CB_CHECK(tree_->m_callbacks, ch != NONE);
605  return {tree_, ch};
606  }

◆ operator>>() [1/4]

ConstNodeRef const& c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator>> ( T &  v) const
inlineinherited

deserialize the node's val to the given variable, forwarding to the user-overrideable read() function.

Definition at line 618 of file node.hpp.

619  {
620  _C4RR();
621  if( ! read((ConstImpl const&)*this, &v))
622  _RYML_CB_ERR(tree_->m_callbacks, "could not deserialize value");
623  return *((ConstImpl const*)this);
624  }
bool read(NodeRef const &n, T *v)
Definition: node.hpp:1620

◆ operator>>() [2/4]

ConstNodeRef const& c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator>> ( Key< T >  v) const
inlineinherited

deserialize the node's key to the given variable, forwarding to the user-overrideable read() function; use key() to disambiguate; for example: node >> ryml::key(var)

Definition at line 630 of file node.hpp.

631  {
632  _C4RR();
633  if( ! readkey((ConstImpl const&)*this, &v.k))
634  _RYML_CB_ERR(tree_->m_callbacks, "could not deserialize key");
635  return *((ConstImpl const*)this);
636  }
bool readkey(NodeRef const &n, T *v)
Definition: node.hpp:1632

◆ operator>>() [3/4]

ConstNodeRef const& c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator>> ( Key< fmt::base64_wrapper w) const
inlineinherited

deserialize the node's key as base64.

lightweight wrapper over deserialize_key()

Definition at line 675 of file node.hpp.

676  {
677  deserialize_key(w.wrapper);
678  return *((ConstImpl const*)this);
679  }
size_t deserialize_key(fmt::base64_wrapper v) const
decode the base64-encoded key and assign the decoded blob to the given buffer/
Definition: node.hpp:691

◆ operator>>() [4/4]

ConstNodeRef const& c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::operator>> ( fmt::base64_wrapper  w) const
inlineinherited

deserialize the node's val as base64.

lightweight wrapper over deserialize_val()

Definition at line 682 of file node.hpp.

683  {
684  deserialize_val(w);
685  return *((ConstImpl const*)this);
686  }
size_t deserialize_val(fmt::base64_wrapper v) const
decode the base64-encoded key and assign the decoded blob to the given buffer/
Definition: node.hpp:699

◆ get_if() [1/2]

bool c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::get_if ( csubstr  name,
T *  var 
) const
inlineinherited

look for a child by name, if it exists assign to var.

return true if the child existed.

Definition at line 641 of file node.hpp.

642  {
643  _C4RR();
644  ConstImpl ch = find_child(name);
645  if(!ch.readable())
646  return false;
647  ch >> *var;
648  return true;
649  }
auto find_child(csubstr name) RYML_NOEXCEPT -> ConstNodeRef
Forward to Tree::first_child().
Definition: node.hpp:348

◆ get_if() [2/2]

bool c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::get_if ( csubstr  name,
T *  var,
T const &  fallback 
) const
inlineinherited

look for a child by name, if it exists assign to var, otherwise default to fallback.

return true if the child existed.

Definition at line 655 of file node.hpp.

656  {
657  _C4RR();
658  ConstImpl ch = find_child(name);
659  if(ch.readable())
660  {
661  ch >> *var;
662  return true;
663  }
664  else
665  {
666  *var = fallback;
667  return false;
668  }
669  }

◆ deserialize_key()

size_t c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::deserialize_key ( fmt::base64_wrapper  v) const
inlineinherited

decode the base64-encoded key and assign the decoded blob to the given buffer/

Returns
the size of base64-decoded blob

Definition at line 691 of file node.hpp.

692  {
693  _C4RR();
694  return from_chars(key(), &v);
695  }
bool from_chars(ryml::csubstr buf, vec2< T > *v)

◆ deserialize_val()

size_t c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::deserialize_val ( fmt::base64_wrapper  v) const
inlineinherited

decode the base64-encoded key and assign the decoded blob to the given buffer/

Returns
the size of base64-decoded blob

Definition at line 699 of file node.hpp.

700  {
701  _C4RR();
702  return from_chars(val(), &v);
703  };
csubstr val() const RYML_NOEXCEPT
Forward to Tree::val().
Definition: node.hpp:212

◆ begin() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::begin ( ) -> iterator
inlineinherited

get an iterator to the first child

Definition at line 731 of file node.hpp.

731 { _C4RR(); return iterator(tree__, tree__->first_child(id__)); }
detail::child_iterator< ConstNodeRef > iterator
Definition: node.hpp:724

◆ begin() [2/2]

get an iterator to the first child

Definition at line 733 of file node.hpp.

733 { _C4RR(); return const_iterator(tree_, tree_->first_child(id_)); }
detail::child_iterator< ConstNodeRef > const_iterator
Definition: node.hpp:725

◆ cbegin()

get an iterator to the first child

Definition at line 735 of file node.hpp.

735 { _C4RR(); return const_iterator(tree_, tree_->first_child(id_)); }

◆ end() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::end ( ) -> iterator
inlineinherited

get an iterator to after the last child

Definition at line 739 of file node.hpp.

739 { _C4RR(); return iterator(tree__, NONE); }

◆ end() [2/2]

get an iterator to after the last child

Definition at line 741 of file node.hpp.

741 { _C4RR(); return const_iterator(tree_, NONE); }

◆ cend()

get an iterator to after the last child

Definition at line 743 of file node.hpp.

743 { _C4RR(); return const_iterator(tree_, tree_->first_child(id_)); }

◆ children() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::children ( ) -> children_view
inlineinherited

get an iterable view over children

Definition at line 747 of file node.hpp.

747 { _C4RR(); return children_view(begin(), end()); }
auto end() RYML_NOEXCEPT -> iterator
get an iterator to after the last child
Definition: node.hpp:739
auto begin() RYML_NOEXCEPT -> iterator
get an iterator to the first child
Definition: node.hpp:731
detail::children_view_< ConstNodeRef > children_view
Definition: node.hpp:726

◆ children() [2/2]

get an iterable view over children

Definition at line 749 of file node.hpp.

749 { _C4RR(); return const_children_view(begin(), end()); }
detail::children_view_< ConstNodeRef > const_children_view
Definition: node.hpp:727

◆ cchildren()

get an iterable view over children

Definition at line 751 of file node.hpp.

751 { _C4RR(); return const_children_view(begin(), end()); }

◆ siblings() [1/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::siblings ( ) -> children_view
inlineinherited

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

Definition at line 755 of file node.hpp.

756  {
757  _C4RR();
758  NodeData const *nd = tree__->get(id__);
759  return (nd->m_parent != NONE) ? // does it have a parent?
760  children_view(iterator(tree__, tree_->get(nd->m_parent)->m_first_child), iterator(tree__, NONE))
761  :
762  children_view(end(), end());
763  }

◆ siblings() [2/2]

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

Definition at line 765 of file node.hpp.

766  {
767  _C4RR();
768  NodeData const *nd = tree_->get(id_);
769  return (nd->m_parent != NONE) ? // does it have a parent?
770  const_children_view(const_iterator(tree_, tree_->get(nd->m_parent)->m_first_child), const_iterator(tree_, NONE))
771  :
773  }

◆ csiblings()

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

Definition at line 775 of file node.hpp.

775 { return siblings(); }
auto siblings() RYML_NOEXCEPT -> children_view
get an iterable view over all siblings (including the calling node)
Definition: node.hpp:755

◆ visit() [1/2]

bool c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::visit ( Visitor  fn,
id_type  indentation_level = 0,
bool  skip_root = true 
) const
inlineinherited

visit every child node calling fn(node)

Definition at line 779 of file node.hpp.

780  {
781  _C4RR();
782  return detail::_visit(*(ConstImpl const*)this, fn, indentation_level, skip_root);
783  }

◆ visit() [2/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::visit ( Visitor  fn,
id_type  indentation_level = 0,
bool  skip_root = true 
) -> bool
inlineinherited

visit every child node calling fn(node)

Definition at line 786 of file node.hpp.

788  {
789  _C4RR();
790  return detail::_visit(*(Impl*)this, fn, indentation_level, skip_root);
791  }

◆ visit_stacked() [1/2]

bool c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::visit_stacked ( Visitor  fn,
id_type  indentation_level = 0,
bool  skip_root = true 
) const
inlineinherited

visit every child node calling fn(node, level)

Definition at line 795 of file node.hpp.

796  {
797  _C4RR();
798  return detail::_visit_stacked(*(ConstImpl const*)this, fn, indentation_level, skip_root);
799  }

◆ visit_stacked() [2/2]

auto c4::yml::detail::RoNodeMethods< ConstNodeRef , ConstNodeRef >::visit_stacked ( Visitor  fn,
id_type  indentation_level = 0,
bool  skip_root = true 
) -> bool
inlineinherited

visit every child node calling fn(node, level)

Definition at line 802 of file node.hpp.

804  {
805  _C4RR();
806  return detail::_visit_stacked(*(Impl*)this, fn, indentation_level, skip_root);
807  }

Friends And Related Function Documentation

◆ detail::RoNodeMethods< ConstNodeRef, ConstNodeRef >

Definition at line 848 of file node.hpp.

Member Data Documentation

◆ m_tree

◆ m_id

◆ NodeRef

friend c4::yml::ConstNodeRef::NodeRef

Definition at line 848 of file node.hpp.


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