rapidyaml  0.16.0
parseandemitYAML,anddoitfast
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< Impl, ConstImpl >

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 (ConstNodeRef const &) noexcept=default
 
 ConstNodeRef (ConstNodeRef &&) noexcept=default
 
 ConstNodeRef (NodeRef const &) noexcept
 
 ConstNodeRef (NodeRef &&) noexcept
 
assignment
ConstNodeRef & operator= (ConstNodeRef const &) noexcept=default
 
ConstNodeRef & operator= (ConstNodeRef &&) noexcept=default
 
ConstNodeRef & operator= (NodeRef const &) noexcept
 
ConstNodeRef & operator= (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
 Forward to Tree::type(). More...
 
hierarchy getters
ConstNodeRef parent () const RYML_NOEXCEPT
 Forward to Tree::parent(). More...
 
ConstNodeRef first_child () const RYML_NOEXCEPT
 Forward to Tree::first_child(). More...
 
ConstNodeRef last_child () const RYML_NOEXCEPT
 Forward to Tree::last_child(). More...
 
ConstNodeRef child (id_type pos) const RYML_NOEXCEPT
 Forward to Tree::child(). More...
 
ConstNodeRef find_child (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::find_child(). More...
 
ConstNodeRef prev_sibling () const RYML_NOEXCEPT
 Forward to Tree::prev_sibling(). More...
 
ConstNodeRef next_sibling () const RYML_NOEXCEPT
 Forward to Tree::next_sibling(). More...
 
ConstNodeRef first_sibling () const RYML_NOEXCEPT
 Forward to Tree::first_sibling(). More...
 
ConstNodeRef last_sibling () const RYML_NOEXCEPT
 Forward to Tree::last_sibling(). More...
 
ConstNodeRef sibling (id_type pos) const RYML_NOEXCEPT
 Forward to Tree::sibling(). More...
 
ConstNodeRef find_sibling (csubstr name) const RYML_NOEXCEPT
 Forward to Tree::find_sibling(). More...
 
ConstNodeRef ancestor_doc () const RYML_NOEXCEPT
 Forward to Tree::ancestor_doc(). More...
 
ConstNodeRef doc (id_type i) const RYML_NOEXCEPT
 Forward to Tree::doc(). More...
 
ReadResult child_r (id_type pos, ConstNodeRef *child) const RYML_NOEXCEPT
 
ReadResult find_child_r (csubstr name, ConstNodeRef *child) const RYML_NOEXCEPT
 Forward to Tree::child_r(). More...
 
ReadResult sibling_r (id_type pos, ConstNodeRef *sibling) const RYML_NOEXCEPT
 Forward to Tree::find_child_r(). More...
 
ReadResult find_sibling_r (csubstr name, ConstNodeRef *sibling) const RYML_NOEXCEPT
 Forward to Tree::sibling_r(). More...
 
square_brackets

Forward to Tree::find_sibling_r().

Node must be readable. operator[]

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).

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...
 
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 (ConstImpl const &ancestor) const RYML_NOEXCEPT
 Forward to Tree::is_ancestor() Node must be readable. More...
 
bool has_child (ConstImpl 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 (ConstImpl 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 (ConstImpl const &n) const RYML_NOEXCEPT
 O(num_children). More...
 
id_type sibling_pos (ConstImpl 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.

template<class T >
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...
 
template<class Wrapper >
void load (Wrapper const &wrapper, bool check_readable=true) const
 (2) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
template<class T >
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...
 
template<class Wrapper >
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
template<class T >
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...
 
template<class Wrapper >
ReadResult deserialize (Wrapper const &wrapper) const
 (2) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
template<class T >
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...
 
template<class Wrapper >
ReadResult deserialize_key (Wrapper const &wrapper) const
 (2) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
lookup and deserialize
template<class T >
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...
 
template<class T >
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...
 
template<class Wrapper >
ReadResult deserialize_child (csubstr child_key, Wrapper const &v) const
 (3) like (1), but for wrapper tag types such as c4::fmt::base64() More...
 
template<class T >
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...
 
template<class T >
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...
 
template<class Wrapper >
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
template<class T >
Impl const & operator>> (T &v) const
 
template<class T >
Impl const & operator>> (T const &wrapper) const
 
template<class T >
Impl const & operator>> (Key< T > const &v) const
 

Public Attributes

Tree const * m_tree
 
id_type m_id
 

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< ConstNodeRef, ConstNodeRef >
 

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...
 
static constexpr bool is_seed () noexcept
 because a ConstNodeRef cannot be used to write to the tree, it can never be a seed. More...
 

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 >
 
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...
 
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...
 
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...
 
const_children_view siblings () const RYML_NOEXCEPT
 
const_children_view csiblings () const RYML_NOEXCEPT
 get an iterable view over all siblings (including the calling node) 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 736 of file node.hpp.

Member Typedef Documentation

Definition at line 740 of file node.hpp.

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

Definition at line 974 of file node.hpp.

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

Definition at line 975 of file node.hpp.

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

Definition at line 976 of file node.hpp.

Definition at line 977 of file node.hpp.

Constructor & Destructor Documentation

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

Definition at line 757 of file node.hpp.

757 : m_tree(nullptr), m_id(NONE) {}
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
c4::yml::ConstNodeRef::ConstNodeRef ( Tree const &  t)
inlinenoexcept

Definition at line 758 of file node.hpp.

758 : m_tree(&t), m_id(t .root_id()) {}
Tree const * m_tree
Definition: node.hpp:744
c4::yml::ConstNodeRef::ConstNodeRef ( Tree const *  t)
inlinenoexcept

Definition at line 759 of file node.hpp.

759 : m_tree(t ), m_id(t->root_id()) {}
Tree const * m_tree
Definition: node.hpp:744
c4::yml::ConstNodeRef::ConstNodeRef ( Tree const *  t,
id_type  id 
)
inlinenoexcept

Definition at line 760 of file node.hpp.

760 : m_tree(t), m_id(id) {}
Tree const * m_tree
Definition: node.hpp:744
c4::yml::ConstNodeRef::ConstNodeRef ( ConstNodeRef const &  )
defaultnoexcept
c4::yml::ConstNodeRef::ConstNodeRef ( ConstNodeRef &&  )
defaultnoexcept
c4::yml::ConstNodeRef::ConstNodeRef ( NodeRef const &  that)
inlinenoexcept

Definition at line 2034 of file node.hpp.

2035  : m_tree(that.m_tree)
2036  , m_id(!that.is_seed() ? that.id() : (id_type)NONE)
2037 {
2038 }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
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
c4::yml::ConstNodeRef::ConstNodeRef ( NodeRef &&  that)
inlinenoexcept

Definition at line 2040 of file node.hpp.

2041  : m_tree(that.m_tree)
2042  , m_id(!that.is_seed() ? that.id() : (id_type)NONE)
2043 {
2044 }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
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

Member Function Documentation

ConstNodeRef& c4::yml::ConstNodeRef::operator= ( ConstNodeRef const &  )
defaultnoexcept
ConstNodeRef& c4::yml::ConstNodeRef::operator= ( ConstNodeRef &&  )
defaultnoexcept
ConstNodeRef & c4::yml::ConstNodeRef::operator= ( NodeRef const &  that)
inlinenoexcept

Definition at line 2047 of file node.hpp.

2048 {
2049  m_tree = (that.m_tree);
2050  m_id = (!that.is_seed() ? that.id() : (id_type)NONE);
2051  return *this;
2052 }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
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
ConstNodeRef & c4::yml::ConstNodeRef::operator= ( NodeRef &&  that)
inlinenoexcept

Definition at line 2054 of file node.hpp.

2055 {
2056  m_tree = (that.m_tree);
2057  m_id = (!that.is_seed() ? that.id() : (id_type)NONE);
2058  return *this;
2059 }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
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 c4::yml::ConstNodeRef::invalid ( ) const
inlinenoexcept

Definition at line 790 of file node.hpp.

Referenced by sample_quick_overview().

790 { return (!m_tree) || (m_id == NONE); }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
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 793 of file node.hpp.

Referenced by c4::yml::emitrs_json(), c4::yml::emitrs_yaml(), and sample_quick_overview().

793 { return m_tree != nullptr && m_id != NONE; }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
static constexpr bool c4::yml::ConstNodeRef::is_seed ( )
inlinestaticnoexcept

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

796 { return false; }
Tree const* c4::yml::ConstNodeRef::tree ( ) const
inlinenoexcept
id_type c4::yml::ConstNodeRef::id ( ) const
inlinenoexcept
bool c4::yml::ConstNodeRef::operator== ( ConstNodeRef const &  that) const
inline

Definition at line 831 of file node.hpp.

831 { return that.m_tree == m_tree && m_id == that.m_id; }
Tree const * m_tree
Definition: node.hpp:744
bool c4::yml::ConstNodeRef::operator!= ( ConstNodeRef const &  that) const
inline

Definition at line 832 of file node.hpp.

832 { return ! this->operator== (that); }
bool operator==(ConstNodeRef const &that) const RYML_NOEXCEPT
Definition: node.hpp:831
NodeData const* c4::yml::ConstNodeRef::get ( ) const
inline

Forward to Tree::type().

Node must be readable.

Definition at line 841 of file node.hpp.

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

Forward to Tree::parent().

Node must be readable.

Definition at line 853 of file node.hpp.

Referenced by sample_quick_overview().

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

Forward to Tree::first_child().

Node must be readable.

Definition at line 854 of file node.hpp.

Referenced by sample_quick_overview().

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

Forward to Tree::last_child().

Node must be readable.

Definition at line 855 of file node.hpp.

Referenced by sample_quick_overview().

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

Forward to Tree::child().

Node must be readable.

Definition at line 856 of file node.hpp.

Referenced by sample_docs().

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

Forward to Tree::find_child().

Node must be readable.

Definition at line 857 of file node.hpp.

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

Forward to Tree::prev_sibling().

Node must be readable.

Definition at line 858 of file node.hpp.

Referenced by sample_quick_overview().

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

Forward to Tree::next_sibling().

Node must be readable.

Definition at line 859 of file node.hpp.

Referenced by sample_quick_overview().

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

Forward to Tree::first_sibling().

Node must be readable.

Definition at line 860 of file node.hpp.

Referenced by sample_quick_overview().

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

Forward to Tree::last_sibling().

Node must be readable.

Definition at line 861 of file node.hpp.

Referenced by sample_quick_overview().

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

Forward to Tree::sibling().

Node must be readable.

Definition at line 862 of file node.hpp.

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

Forward to Tree::find_sibling().

Node must be readable.

Definition at line 863 of file node.hpp.

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

Forward to Tree::ancestor_doc().

Node must be readable.

Definition at line 864 of file node.hpp.

ConstNodeRef c4::yml::ConstNodeRef::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 865 of file node.hpp.

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

Definition at line 867 of file node.hpp.

Referenced by child_r().

867 { 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. */
Tree const * m_tree
Definition: node.hpp:744
ConstNodeRef child(id_type pos) const RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:856
ReadResult child_r(id_type pos, ConstNodeRef *child) const RYML_NOEXCEPT
Definition: node.hpp:867
ReadResult c4::yml::ConstNodeRef::find_child_r ( csubstr  name,
ConstNodeRef *  child 
) const
inline

Forward to Tree::child_r().

Node must be readable.

Definition at line 868 of file node.hpp.

868 { 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
Tree const * m_tree
Definition: node.hpp:744
ConstNodeRef child(id_type pos) const RYML_NOEXCEPT
Forward to Tree::child().
Definition: node.hpp:856
ReadResult c4::yml::ConstNodeRef::sibling_r ( id_type  pos,
ConstNodeRef *  sibling 
) const
inline

Forward to Tree::find_child_r().

Node must be readable.

Definition at line 870 of file node.hpp.

Referenced by sibling_r().

870 { 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. */
ConstNodeRef sibling(id_type pos) const RYML_NOEXCEPT
Forward to Tree::sibling().
Definition: node.hpp:862
Tree const * m_tree
Definition: node.hpp:744
ReadResult sibling_r(id_type pos, ConstNodeRef *sibling) const RYML_NOEXCEPT
Forward to Tree::find_child_r().
Definition: node.hpp:870
ReadResult c4::yml::ConstNodeRef::find_sibling_r ( csubstr  name,
ConstNodeRef *  sibling 
) const
inline

Forward to Tree::sibling_r().

Node must be readable.

Definition at line 871 of file node.hpp.

871 { 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. */
ConstNodeRef sibling(id_type pos) const RYML_NOEXCEPT
Forward to Tree::sibling().
Definition: node.hpp:862
Tree const * m_tree
Definition: node.hpp:744
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
ConstNodeRef c4::yml::ConstNodeRef::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 890 of file node.hpp.

891  {
892  assert_readable_();
893  id_type ch = m_tree->find_child(m_id, key);
894  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
895  return {m_tree, ch};
896  }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
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::ConstNodeRef::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 907 of file node.hpp.

908  {
909  assert_readable_();
910  id_type ch = m_tree->child(m_id, pos);
911  RYML_ASSERT_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
912  return {m_tree, ch};
913  }
an index to none
Definition: common.hpp:131
Tree const * m_tree
Definition: node.hpp:744
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
ConstNodeRef c4::yml::ConstNodeRef::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 938 of file node.hpp.

939  {
940  check_readable_();
941  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, m_tree->is_map(m_id), m_tree, m_id);
942  id_type ch = m_tree->find_child(m_id, key);
943  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
944  return {m_tree, ch};
945  }
an index to none
Definition: common.hpp:131
bool is_map(id_type node) const
Definition: tree.hpp:480
Tree const * m_tree
Definition: node.hpp:744
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::ConstNodeRef::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 956 of file node.hpp.

957  {
958  check_readable_();
959  const id_type cap = m_tree->capacity();
960  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, (pos >= 0 && pos < cap), m_tree, m_id);
961  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, m_tree->is_container(m_id), m_tree, m_id);
962  const id_type ch = m_tree->child(m_id, pos);
963  RYML_CHECK_VISIT_CB_(m_tree->m_callbacks, ch != NONE, m_tree, m_id);
964  return {m_tree, ch};
965  }
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
Tree const * m_tree
Definition: node.hpp:744
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
const_iterator c4::yml::ConstNodeRef::begin ( ) const
inline

get an iterator to the first child

Definition at line 980 of file node.hpp.

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

get an iterator to the first child

Definition at line 981 of file node.hpp.

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

get an iterator to after the last child

Definition at line 983 of file node.hpp.

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

get an iterator to after the last child

Definition at line 984 of file node.hpp.

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

get an iterable view over children

Definition at line 987 of file node.hpp.

Referenced by c4::yml::read(), sample_docs(), sample_float_precision(), sample_iterate_tree(), sample_quick_overview(), and sample_tags().

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

get an iterable view over children

Definition at line 988 of file node.hpp.

const_children_view c4::yml::ConstNodeRef::siblings ( ) const
inline

Definition at line 990 of file node.hpp.

990 { 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) */
Tree const * m_tree
Definition: node.hpp:744
const_children_view c4::yml::ConstNodeRef::csiblings ( ) const
inline

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

Definition at line 991 of file node.hpp.

991 { 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) */
Tree const * m_tree
Definition: node.hpp:744
template<class Impl, class ConstImpl>
NodeType c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::type ( ) const
inlineinherited

Forward to Tree::type().

Node must be readable.

Definition at line 172 of file node.hpp.

Referenced by sample_style_flow_formatting().

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::key ( ) const
inlineinherited

Forward to Tree::key().

Node must be readable.

Definition at line 174 of file node.hpp.

Referenced by sample_quick_overview().

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::key_tag ( ) const
inlineinherited

Forward to Tree::key_tag().

Node must be readable.

Definition at line 175 of file node.hpp.

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::key_ref ( ) const
inlineinherited

Forward to Tree::key_ref().

Node must be readable.

Definition at line 176 of file node.hpp.

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::key_anchor ( ) const
inlineinherited

Forward to Tree::key_anchor().

Node must be readable.

Definition at line 177 of file node.hpp.

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val ( ) const
inlineinherited

Forward to Tree::val().

Node must be readable.

Definition at line 179 of file node.hpp.

Referenced by sample_base64(), sample_create_tree(), sample_fundamental_types(), and sample_quick_overview().

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val_tag ( ) const
inlineinherited

Forward to Tree::val_tag().

Node must be readable.

Definition at line 180 of file node.hpp.

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val_ref ( ) const
inlineinherited

Forward to Tree::val_ref().

Node must be readable.

Definition at line 181 of file node.hpp.

template<class Impl, class ConstImpl>
csubstr c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val_anchor ( ) const
inlineinherited

Forward to Tree::val_anchor().

Node must be readable.

Definition at line 182 of file node.hpp.

template<class Impl, class ConstImpl>
NodeScalar const& c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::keysc ( ) const
inlineinherited

Forward to Tree::keysc().

Node must be readable.

Definition at line 184 of file node.hpp.

template<class Impl, class ConstImpl>
NodeScalar const& c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::valsc ( ) const
inlineinherited

Forward to Tree::valsc().

Node must be readable.

Definition at line 185 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::key_is_null ( ) const
inlineinherited

Forward to Tree::key_is_null().

Node must be readable.

Definition at line 187 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val_is_null ( ) const
inlineinherited

Forward to Tree::val_is_null().

Node must be readable.

Definition at line 188 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_unfiltered ( ) const
inlinenoexceptinherited

Forward to Tree::is_key_unfiltered().

Node must be readable.

Definition at line 190 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_unfiltered ( ) const
inlinenoexceptinherited

Forward to Tree::is_val_unfiltered().

Node must be readable.

Definition at line 191 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::empty ( ) const
inlineinherited

Forward to Tree::empty().

Node must be readable.

Definition at line 203 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_stream ( ) const
inlineinherited

Forward to Tree::is_stream().

Node must be readable.

Definition at line 204 of file node.hpp.

Referenced by sample_docs(), and sample_tags().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_doc ( ) const
inlineinherited

Forward to Tree::is_doc().

Node must be readable.

Definition at line 205 of file node.hpp.

Referenced by sample_docs().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_container ( ) const
inlineinherited

Forward to Tree::is_container().

Node must be readable.

Definition at line 206 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_map ( ) const
inlineinherited

Forward to Tree::is_map().

Node must be readable.

Definition at line 207 of file node.hpp.

Referenced by c4::yml::read(), read(), sample_parse_in_arena(), sample_parse_in_place(), and sample_parse_reuse_tree().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_seq ( ) const
inlineinherited

Forward to Tree::is_seq().

Node must be readable.

Definition at line 208 of file node.hpp.

Referenced by c4::yml::read(), read(), sample_parse_reuse_tree(), and sample_quick_overview().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_val ( ) const
inlineinherited

Forward to Tree::has_val().

Node must be readable.

Definition at line 209 of file node.hpp.

Referenced by sample_quick_overview().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_key ( ) const
inlineinherited

Forward to Tree::has_key().

Node must be readable.

Definition at line 210 of file node.hpp.

Referenced by sample_quick_overview().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val ( ) const
inlineinherited

Forward to Tree::is_val().

Node must be readable.

Definition at line 211 of file node.hpp.

Referenced by sample_quick_overview().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_keyval ( ) const
inlineinherited

Forward to Tree::is_keyval().

Node must be readable.

Definition at line 212 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_key_tag ( ) const
inlineinherited

Forward to Tree::has_key_tag().

Node must be readable.

Definition at line 213 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_val_tag ( ) const
inlineinherited

Forward to Tree::has_val_tag().

Node must be readable.

Definition at line 214 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_key_anchor ( ) const
inlineinherited

Forward to Tree::has_key_anchor().

Node must be readable.

Definition at line 215 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_val_anchor ( ) const
inlineinherited

Forward to Tree::has_val_anchor().

Node must be readable.

Definition at line 216 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_anchor ( ) const
inlineinherited

Forward to Tree::has_anchor().

Node must be readable.

Definition at line 217 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_ref ( ) const
inlineinherited

Forward to Tree::is_key_ref().

Node must be readable.

Definition at line 218 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_ref ( ) const
inlineinherited

Forward to Tree::is_val_ref().

Node must be readable.

Definition at line 219 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_ref ( ) const
inlineinherited

Forward to Tree::is_ref().

Node must be readable.

Definition at line 220 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::parent_is_seq ( ) const
inlineinherited

Forward to Tree::parent_is_seq().

Node must be readable.

Definition at line 221 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::parent_is_map ( ) const
inlineinherited

Forward to Tree::parent_is_map().

Node must be readable.

Definition at line 222 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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.

template<class Impl, class ConstImpl>
NodeType c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::key_style ( ) const
inlineinherited

Forward to Tree::key_style().

Node must be readable.

Definition at line 238 of file node.hpp.

template<class Impl, class ConstImpl>
NodeType c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val_style ( ) const
inlineinherited

Forward to Tree::val_style().

Node must be readable.

Definition at line 239 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_container_styled ( ) const
inlineinherited

Forward to Tree::is_container_styled().

Node must be readable.

Definition at line 241 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_block ( ) const
inlineinherited

Forward to Tree::is_block().

Node must be readable.

Definition at line 242 of file node.hpp.

Referenced by sample_parse_style(), and sample_style().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_flow ( ) const
inlineinherited

Forward to Tree::is_flow().

Node must be readable.

Definition at line 243 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_flow_sl ( ) const
inlineinherited

Forward to Tree::is_flow_sl().

Node must be readable.

Definition at line 244 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_flow_ml ( ) const
inlineinherited

Forward to Tree::is_flow_ml1().

Node must be readable.

Definition at line 246 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_flow_ml1 ( ) const
inlineinherited

Forward to Tree::is_flow_ml1().

Node must be readable.

Definition at line 247 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_flow_mln ( ) const
inlineinherited

Forward to Tree::is_flow_mln().

Node must be readable.

Definition at line 248 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_flow_mlx ( ) const
inlineinherited

Forward to Tree::is_flow_mlx().

Node must be readable.

Definition at line 249 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_flow_space ( ) const
inlineinherited

Forward to Tree::has_flow_space().

Node must be readable.

Definition at line 250 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_styled ( ) const
inlineinherited

Forward to Tree::is_key_styled().

Node must be readable.

Definition at line 252 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_styled ( ) const
inlineinherited

Forward to Tree::is_val_styled().

Node must be readable.

Definition at line 253 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_literal ( ) const
inlineinherited

Forward to Tree::is_key_literal().

Node must be readable.

Definition at line 254 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_literal ( ) const
inlineinherited

Forward to Tree::is_val_literal().

Node must be readable.

Definition at line 255 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_folded ( ) const
inlineinherited

Forward to Tree::is_key_folded().

Node must be readable.

Definition at line 256 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_folded ( ) const
inlineinherited

Forward to Tree::is_val_folded().

Node must be readable.

Definition at line 257 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_squo ( ) const
inlineinherited

Forward to Tree::is_key_squo().

Node must be readable.

Definition at line 258 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_squo ( ) const
inlineinherited

Forward to Tree::is_val_squo().

Node must be readable.

Definition at line 259 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_dquo ( ) const
inlineinherited

Forward to Tree::is_key_dquo().

Node must be readable.

Definition at line 260 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_dquo ( ) const
inlineinherited

Forward to Tree::is_val_dquo().

Node must be readable.

Definition at line 261 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_plain ( ) const
inlineinherited

Forward to Tree::is_key_plain().

Node must be readable.

Definition at line 262 of file node.hpp.

Referenced by sample_create_tree_style().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_plain ( ) const
inlineinherited

Forward to Tree::is_val_plain().

Node must be readable.

Definition at line 263 of file node.hpp.

Referenced by sample_create_tree_style().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_key_quoted ( ) const
inlineinherited

Forward to Tree::is_key_quoted().

Node must be readable.

Definition at line 264 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_val_quoted ( ) const
inlineinherited

Forward to Tree::is_val_quoted().

Node must be readable.

Definition at line 265 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_quoted ( ) const
inlineinherited

Forward to Tree::is_quoted().

Node must be readable.

Definition at line 266 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_root ( ) const
inlineinherited

Forward to Tree::is_root().

Node must be readable.

Definition at line 278 of file node.hpp.

Referenced by sample_docs().

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_parent ( ) const
inlineinherited

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

Definition at line 279 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::is_ancestor ( ConstImpl const &  ancestor) const
inlineinherited

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

Definition at line 280 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_child ( ConstImpl const &  n) const
inlineinherited

Forward to Tree::has_child().

Node must be readable.

Definition at line 282 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_child ( id_type  node) const
inlineinherited

Forward to Tree::has_child().

Node must be readable.

Definition at line 283 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_child ( csubstr  name) const
inlineinherited

Forward to Tree::has_child().

Node must be readable.

Definition at line 284 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_children ( ) const
inlineinherited

Forward to Tree::has_children().

Node must be readable.

Definition at line 285 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_sibling ( ConstImpl const &  n) const
inlineinherited

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 287 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_sibling ( id_type  node) const
inlineinherited

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 288 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_sibling ( csubstr  name) const
inlineinherited

Forward to Tree::has_sibling().

Node must be readable.

Definition at line 289 of file node.hpp.

template<class Impl, class ConstImpl>
bool c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::has_other_siblings ( ) const
inlineinherited

Forward to Tree::has_other_siblings().

Node must be readable.

Definition at line 290 of file node.hpp.

template<class Impl, class ConstImpl>
id_type c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_children ( ) const
inlineinherited

O(num_children).

Forward to Tree::num_children().

Definition at line 302 of file node.hpp.

Referenced by sample_docs(), sample_parse_reuse_tree(), and sample_tags().

template<class Impl, class ConstImpl>
id_type c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_siblings ( ) const
inlineinherited

O(num_children).

Forward to Tree::num_siblings().

Definition at line 303 of file node.hpp.

Referenced by sample_quick_overview().

template<class Impl, class ConstImpl>
id_type c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_other_siblings ( ) const
inlineinherited

O(num_siblings).

Forward to Tree::num_other_siblings().

Definition at line 304 of file node.hpp.

template<class Impl, class ConstImpl>
id_type c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::child_pos ( ConstImpl const &  n) const
inlineinherited

O(num_children).

Forward to Tree::child_pos().

Definition at line 305 of file node.hpp.

template<class Impl, class ConstImpl>
id_type c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::sibling_pos ( ConstImpl const &  n) const
inlineinherited

O(num_siblings).

Forward to Tree::sibling_pos().

Definition at line 306 of file node.hpp.

template<class Impl, class ConstImpl>
id_type c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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. */
template<class Impl, class ConstImpl>
id_type c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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. */
template<class Impl, class ConstImpl>
Location c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::location ( Parser const &  parser) const
inlineinherited

Definition at line 318 of file node.hpp.

Referenced by sample_location_tracking(), and sample_quick_overview().

319  {
320  this_assert_readable_();
321  return tree_->location(parser, id_);
322  }
Parser parser
Definition: parse.cpp:117
template<class Impl, class ConstImpl>
template<class T >
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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.

Referenced by sample_base64(), sample_deserialize_error(), sample_float_precision(), sample_fundamental_types(), sample_lightning_overview(), sample_parse_in_arena(), sample_parse_in_place(), sample_std_types(), sample_user_container_types(), sample_user_container_types_brief(), and sample_user_scalar_types().

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
void assert_val_() const noexcept
Definition: node.hpp:624
void check_val_() const
Definition: node.hpp:589
ReadResult read(ConstNodeRef const &n, T *v)
Definition: node.hpp:2074
template<class Impl, class ConstImpl>
template<class Wrapper >
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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
void assert_val_() const noexcept
Definition: node.hpp:624
void check_val_() const
Definition: node.hpp:589
ReadResult read(ConstNodeRef const &n, T *v)
Definition: node.hpp:2074
template<class Impl, class ConstImpl>
template<class T >
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
void check_key_() const
Definition: node.hpp:598
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
void assert_key_() const noexcept
Definition: node.hpp:625
ReadResult read_key(ConstNodeRef const &n, T *v)
Definition: node.hpp:2088
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
template<class Impl, class ConstImpl>
template<class Wrapper >
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
void check_key_() const
Definition: node.hpp:598
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
void assert_key_() const noexcept
Definition: node.hpp:625
ReadResult read_key(ConstNodeRef const &n, T *v)
Definition: node.hpp:2088
csubstr key() const RYML_NOEXCEPT
Forward to Tree::key().
Definition: node.hpp:174
template<class Impl, class ConstImpl>
template<class T >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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.

Referenced by sample_deserialize_error().

429  {
430  assert_val_();
431  // use the adapter ctor to accomodate legacy read() implementations
432  return ReadResult(read((ConstImpl const&)*this, v), id_);
433  }
void assert_val_() const noexcept
Definition: node.hpp:624
ReadResult read(ConstNodeRef const &n, T *v)
Definition: node.hpp:2074
template<class Impl, class ConstImpl>
template<class Wrapper >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
void assert_val_() const noexcept
Definition: node.hpp:624
ReadResult read(ConstNodeRef const &n, T *v)
Definition: node.hpp:2074
template<class Impl, class ConstImpl>
template<class T >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
void assert_key_() const noexcept
Definition: node.hpp:625
ReadResult read_key(ConstNodeRef const &n, T *v)
Definition: node.hpp:2088
template<class Impl, class ConstImpl>
template<class Wrapper >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
void assert_key_() const noexcept
Definition: node.hpp:625
ReadResult read_key(ConstNodeRef const &n, T *v)
Definition: node.hpp:2088
template<class Impl, class ConstImpl>
template<class T >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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.

Referenced by read().

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  }
template<class Impl, class ConstImpl>
template<class T >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
template<class Impl, class ConstImpl>
template<class Wrapper >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
template<class Impl, class ConstImpl>
template<class T >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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(ConstImpl const &n) const RYML_NOEXCEPT
O(num_children).
Definition: node.hpp:305
template<class Impl, class ConstImpl>
template<class T >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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(ConstImpl const &n) const RYML_NOEXCEPT
O(num_children).
Definition: node.hpp:305
template<class Impl, class ConstImpl>
template<class Wrapper >
ReadResult c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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(ConstImpl const &n) const RYML_NOEXCEPT
O(num_children).
Definition: node.hpp:305
template<class Impl, class ConstImpl>
template<class T >
Impl const& c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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
template<class Impl, class ConstImpl>
template<class T >
Impl const& c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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
template<class Impl, class ConstImpl>
template<class T >
Impl const& c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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
template<class Impl, class ConstImpl>
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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
static void err_basic_(const char *msg)
Definition: node.hpp:609
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
template<class Impl, class ConstImpl>
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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
static void err_basic_(const char *msg)
Definition: node.hpp:609
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
template<class Impl, class ConstImpl>
static void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::err_basic_ ( const char *  msg)
inlinestaticprotectedinherited

Definition at line 609 of file node.hpp.

610  {
611  RYML_ERR_BASIC_(msg);
612  }
template<class Impl, class ConstImpl>
static void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::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  }
template<class Impl, class ConstImpl>
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::assert_val_ ( ) const
inlineprotectednoexceptinherited

Definition at line 624 of file node.hpp.

624 {}
template<class Impl, class ConstImpl>
void c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::assert_key_ ( ) const
inlineprotectednoexceptinherited

Definition at line 625 of file node.hpp.

625 {}

Friends And Related Function Documentation

Definition at line 750 of file node.hpp.

Member Data Documentation


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