|
rapidyaml
0.16.0
parseandemitYAML,anddoitfast
|
#include <tree.hpp>
Classes | |
| struct | lookup_result |
Public Member Functions | |
construction and assignment | |
| Tree () | |
| Tree (Callbacks const &cb) | |
| Tree (id_type node_capacity, size_t arena_capacity=RYML_DEFAULT_TREE_ARENA_CAPACITY) | |
| Tree (id_type node_capacity, size_t arena_capacity, Callbacks const &cb) | |
| ~Tree () noexcept | |
| Tree (Tree const &that) | |
| Tree (Tree &&that) noexcept | |
| Tree & | operator= (Tree const &that) |
| Tree & | operator= (Tree &&that) noexcept |
memory and sizing | |
| void | reserve (id_type node_capacity=RYML_DEFAULT_TREE_CAPACITY) |
| void | clear () |
| clear the tree and zero every node More... | |
| void | clear_arena () |
| bool | empty () const |
| Query for zero size. More... | |
| id_type | size () const |
| id_type | capacity () const |
| id_type | slack () const |
| Callbacks const & | callbacks () const |
| void | callbacks (Callbacks const &cb) |
node getters | |
| NodeData * | get (id_type node) |
| get a pointer to a node's NodeData. node can be NONE, in which case a nullptr is returned More... | |
| NodeData const * | get (id_type node) const |
| get a pointer to a node's NodeData. node can be NONE, in which case a nullptr is returned. More... | |
| NodeData * | _p (id_type node) |
| An if-less form of get() that demands a valid node index. This function is implementation only; use at your own risk. More... | |
| NodeData const * | _p (id_type node) const |
| An if-less form of get() that demands a valid node index. This function is implementation only; use at your own risk. More... | |
| id_type | root_id () const |
| Get the id of the root node. The tree must not be empty. The tree can be empty only when constructed with explicitly zero-capacity. More... | |
| id_type | root_id_maybe () const |
| Get the id of the root node, or NONE if the tree is empty. More... | |
| id_type | id (NodeData const *n) const |
get the id of a node belonging to this tree. n can be nullptr, in which case NONE is returned n must belong to this tree More... | |
NodeRef helpers | |
| NodeRef | ref (id_type node) |
| Get a NodeRef of a node by id. More... | |
| ConstNodeRef | ref (id_type node) const |
| Get a NodeRef of a node by id. More... | |
| ConstNodeRef | cref (id_type node) const |
| Get a NodeRef of a node by id. More... | |
| NodeRef | rootref () |
| Get the root as a NodeRef . Note that a non-const Tree implicitly converts to NodeRef. More... | |
| ConstNodeRef | rootref () const |
| Get the root as a ConstNodeRef . Note that Tree implicitly converts to ConstNodeRef. More... | |
| ConstNodeRef | crootref () const |
| Get the root as a ConstNodeRef . Note that Tree implicitly converts to ConstNodeRef. More... | |
| NodeRef | docref (id_type i) |
| get the i-th document of the stream More... | |
| ConstNodeRef | docref (id_type i) const |
| get the i-th document of the stream More... | |
| ConstNodeRef | cdocref (id_type i) const |
| get the i-th document of the stream More... | |
| NodeRef | operator[] (csubstr key) |
| find a root child (ie child of root) by name, return it as a NodeRef More... | |
| ConstNodeRef | operator[] (csubstr key) const |
| find a root child (ie child of root) by name, return it as a NodeRef More... | |
| NodeRef | operator[] (id_type i) |
find a root child (ie child of root) by index: return the root node's i-th child as a NodeRef More... | |
| ConstNodeRef | operator[] (id_type i) const |
find a root child (ie child of root) by index: return the root node's i-th child as a NodeRef More... | |
node property getters | |
| NodeType | type (id_type node) const |
| csubstr const & | key (id_type node) const |
| csubstr const & | key_tag (id_type node) const |
| csubstr const & | key_ref (id_type node) const |
| csubstr const & | key_anchor (id_type node) const |
| NodeScalar const & | keysc (id_type node) const |
| csubstr const & | val (id_type node) const |
| csubstr const & | val_tag (id_type node) const |
| csubstr const & | val_ref (id_type node) const |
| csubstr const & | val_anchor (id_type node) const |
| NodeScalar const & | valsc (id_type node) const |
node type predicates | |
| bool | type_has_any (id_type node, type_bits bits) const |
| bool | type_has_all (id_type node, type_bits bits) const |
| bool | type_has_none (id_type node, type_bits bits) const |
| bool | is_stream (id_type node) const |
| bool | is_doc (id_type node) const |
| bool | is_container (id_type node) const |
| bool | is_map (id_type node) const |
| bool | is_seq (id_type node) const |
| bool | has_key (id_type node) const |
| bool | has_val (id_type node) const |
| bool | is_val (id_type node) const |
| bool | is_keyval (id_type node) const |
| bool | has_key_tag (id_type node) const |
| bool | has_val_tag (id_type node) const |
| bool | has_key_anchor (id_type node) const |
| bool | has_val_anchor (id_type node) const |
| bool | has_anchor (id_type node) const |
| bool | is_key_ref (id_type node) const |
| bool | is_val_ref (id_type node) const |
| bool | is_ref (id_type node) const |
| bool | parent_is_seq (id_type node) const |
| bool | parent_is_map (id_type node) const |
| bool | has_anchor (id_type node, csubstr a) const |
| true when the node has an anchor named a More... | |
| bool | key_is_null (id_type node) const |
| true if the node key is empty, or its scalar verifies scalar_is_null(). More... | |
| bool | val_is_null (id_type node) const |
| true if the node val is empty, or its scalar verifies scalar_is_null(). More... | |
| bool | is_key_unfiltered (id_type node) const |
| true if the key was a scalar requiring filtering and was left unfiltered during the parsing (see ParserOptions) More... | |
| bool | is_val_unfiltered (id_type node) const |
| true if the val was a scalar requiring filtering and was left unfiltered during the parsing (see ParserOptions) More... | |
| bool | is_key_anchor (id_type node) const |
| bool | is_val_anchor (id_type node) const |
| bool | is_anchor (id_type node) const |
| bool | is_anchor_or_ref (id_type node) const |
hierarchy predicates | |
| bool | is_root (id_type node) const |
| bool | has_parent (id_type node) const |
| bool | is_ancestor (id_type node, id_type ancestor) const |
| true when ancestor is parent or parent of a parent of node More... | |
| bool | empty (id_type node) const |
| true when key and val are empty, and has no children More... | |
| bool | has_child (id_type node, id_type ch) const |
true if node has a child with id ch More... | |
| bool | has_child (id_type node, csubstr key) const |
true if node has a child with key key More... | |
| bool | has_children (id_type node) const |
true if node has any children More... | |
| bool | has_sibling (id_type node, id_type sib) const |
true if node has a sibling with id sib More... | |
| bool | has_sibling (id_type node, csubstr key) const |
| true if one of the node's siblings has the given key More... | |
| bool | has_other_siblings (id_type node) const |
| true if node is not a single child More... | |
hierarchy getters | |
| id_type | parent (id_type node) const |
| id_type | prev_sibling (id_type node) const |
| id_type | next_sibling (id_type node) const |
| id_type | num_children (id_type node) const |
| O(num_children) More... | |
| id_type | child_pos (id_type node, id_type ch) const |
| id_type | first_child (id_type node) const |
| id_type | last_child (id_type node) const |
| id_type | child (id_type node, id_type pos) const |
| find child by position, or NONE if there are less than pos children posi More... | |
| 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 More... | |
| ReadResult | child_r (id_type node, id_type pos, id_type *child_id) const |
| 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 More... | |
| id_type | num_siblings (id_type node) const |
| O(num_siblings) More... | |
| id_type | num_other_siblings (id_type node) const |
| does not count with this More... | |
| id_type | sibling_pos (id_type node, id_type sib) const |
| id_type | first_sibling (id_type node) const |
| id_type | last_sibling (id_type node) const |
| id_type | sibling (id_type node, id_type pos) const |
| id_type | find_sibling (id_type node, csubstr const &key) const |
| ReadResult | sibling_r (id_type node, id_type pos, id_type *sibling_id) const |
| like Tree::sibling(), but return a ReadResult with the status More... | |
| 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 More... | |
| id_type | depth_asc (id_type node) const |
| O(log(num_tree_nodes)) get the ascending depth of the node: number of levels between root and node. More... | |
| id_type | depth_desc (id_type node) const |
| O(num_tree_nodes) get the descending depth of the node: number of levels between node and deepest child. More... | |
| id_type | doc (id_type i) const |
gets the i document node index. More... | |
| id_type | ancestor_doc (id_type node) const |
| get the document which is a parent document of node i, or the root if the tree is not a stream More... | |
node style predicates and modifiers. see the corresponding predicate in NodeType | |
| bool | is_container_styled (id_type node) const |
| bool | is_block (id_type node) const |
| bool | is_flow_sl (id_type node) const |
| bool | is_flow_ml (id_type node) const |
| bool | is_flow_ml1 (id_type node) const |
| bool | is_flow_mln (id_type node) const |
| bool | is_flow_mlx (id_type node) const |
| bool | is_flow (id_type node) const |
| bool | has_flow_space (id_type node) const |
| bool | is_key_styled (id_type node) const |
| bool | is_val_styled (id_type node) const |
| bool | is_key_literal (id_type node) const |
| bool | is_val_literal (id_type node) const |
| bool | is_key_folded (id_type node) const |
| bool | is_val_folded (id_type node) const |
| bool | is_key_squo (id_type node) const |
| bool | is_val_squo (id_type node) const |
| bool | is_key_dquo (id_type node) const |
| bool | is_val_dquo (id_type node) const |
| bool | is_key_plain (id_type node) const |
| bool | is_val_plain (id_type node) const |
| bool | is_key_quoted (id_type node) const |
| bool | is_val_quoted (id_type node) const |
| bool | is_quoted (id_type node) const |
| NodeType | key_style (id_type node) const |
| NodeType | val_style (id_type node) const |
| void | set_container_style (id_type node, type_bits style) |
| void | set_key_style (id_type node, type_bits style) |
| void | set_val_style (id_type node, type_bits style) |
| void | clear_style (id_type node, bool recurse=false) |
| void | set_style_conditionally (id_type node, NodeType type_mask, NodeType rem_style_flags, NodeType add_style_flags, bool recurse=false) |
node type modifiers | |
| void | set_stream (id_type node) |
| void | set_doc (id_type node) |
| void | set_val (id_type node, csubstr val) RYML_NOEXCEPT |
| void | set_val (id_type node, csubstr val, NodeType more_flags) RYML_NOEXCEPT |
| void | set_key (id_type node, csubstr key) RYML_NOEXCEPT |
| void | set_key (id_type node, csubstr key, NodeType more_flags) RYML_NOEXCEPT |
| void | set_seq (id_type node) RYML_NOEXCEPT |
| void | set_seq (id_type node, NodeType more_flags) RYML_NOEXCEPT |
| void | set_map (id_type node) RYML_NOEXCEPT |
| void | set_map (id_type node, NodeType more_flags) RYML_NOEXCEPT |
| void | set_key_tag (id_type node, csubstr tag) |
| void | set_val_tag (id_type node, csubstr tag) |
| void | set_key_anchor (id_type node, csubstr anchor) |
| void | set_val_anchor (id_type node, csubstr anchor) |
| void | set_key_ref (id_type node, csubstr ref) |
| void | set_val_ref (id_type node, csubstr ref) |
| void | rem_key_anchor (id_type node) |
| void | rem_val_anchor (id_type node) |
| void | rem_key_ref (id_type node) |
| void | rem_val_ref (id_type node) |
| void | rem_anchor_ref (id_type node) |
serialization - checked | |
| template<class T > | |
| void | save (id_type node, T const &val) |
| template<class T > | |
| void | save (id_type node, T const &val, NodeType more_flags) |
| template<class T > | |
| void | save_key (id_type node, T const &key) |
| template<class T > | |
| void | save_key (id_type node, T const &key, NodeType more_flags) |
serialization - asserted | |
| template<class T > | |
| void | set_serialized (id_type node, T const &val) RYML_NOEXCEPT |
| template<class T > | |
| void | set_serialized (id_type node, T const &val, NodeType more_flags) RYML_NOEXCEPT |
| template<class T > | |
| void | set_key_serialized (id_type node, T const &key) RYML_NOEXCEPT |
| template<class T > | |
| void | set_key_serialized (id_type node, T const &key, NodeType more_flags) RYML_NOEXCEPT |
deserialization - asserted preconditions | |
| template<class T > | |
| ReadResult | deserialize (id_type node, T *v) const |
| (1) deserialize a node's contents to a variable More... | |
| template<class Wrapper > | |
| ReadResult | deserialize (id_type node, Wrapper const &w) const |
| (2) like (1), but for a wrapper type like those used in tag functions More... | |
| template<class T > | |
| ReadResult | deserialize_key (id_type node, T *v) const |
| (1) deserialize a node's key to a variable More... | |
| template<class Wrapper > | |
| ReadResult | deserialize_key (id_type node, Wrapper const &w) const |
| (2) like (1), but for a wrapper type like those used in tag functions More... | |
lookup and deserialize | |
| template<class T > | |
| ReadResult | deserialize_child (id_type node, 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 (id_type node, 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 (id_type node, csubstr child_key, Wrapper const &wrapper) const |
| (3) like (1), but for wrapper tag types such as c4::fmt::base64() More... | |
| template<class T > | |
| ReadResult | deserialize_child (id_type node, 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 node, 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 node, id_type child_pos, Wrapper const &wrapper) const |
| (3) like (1), but for wrapper tag types such as c4::fmt::base64() More... | |
tree modifiers | |
| void | reorder () |
| reorder the tree in memory so that all the nodes are stored in a linear sequence when visited in depth-first order. More... | |
anchors and references/aliases | |
| void | resolve (ReferenceResolver *rr, bool clear_anchors=true) |
| Resolve references (aliases <- anchors), by forwarding to ReferenceResolver::resolve(); refer to ReferenceResolver::resolve() for further details. More... | |
| void | resolve (bool clear_anchors=true) |
| Resolve references (aliases <- anchors), by forwarding to ReferenceResolver::resolve(); refer to ReferenceResolver::resolve() for further details. More... | |
tags and tag directives | |
| void | resolve_tags (TagCache &cache, bool all=true) |
Resolve tags in the tree such as "!!str" -> "<tag:yaml.org,2002:str>", "!foo" -> "<!foo>" and custom tags as well, ie tags of the form "!handle!tag" for which there is a corresponding "%TAG" directive. More... | |
| void | normalize_tags () |
| void | normalize_tags_long () |
| id_type | num_tag_directives () const |
| void | add_tag_directive (csubstr handle, csubstr prefix, id_type id) |
| void | clear_tag_directives () |
| size_t | resolve_tag (substr output, csubstr tag, id_type node_id) const |
| resolve the given tag, appearing at node_id. More... | |
| csubstr | resolve_tag_sub (substr output, csubstr tag, id_type node_id) const |
| Wrapper for Tree::resolve_tag(), returning a substring. More... | |
| c4::yml::TagDirectiveRange | tag_directives () const |
modifying hierarchy | |
| id_type | insert_child (id_type parent, id_type after) |
create and insert a new child of parent. More... | |
| id_type | prepend_child (id_type parent) |
create and insert a node as the first child of parent More... | |
| id_type | append_child (id_type parent) |
create and insert a node as the last child of parent More... | |
| id_type | _append_child__unprotected (id_type parent) |
| id_type | insert_sibling (id_type node, id_type after) |
| create and insert a new sibling of n. insert after "after" More... | |
| id_type | prepend_sibling (id_type node) |
create and insert a node as the first node of parent More... | |
| id_type | append_sibling (id_type node) |
| void | remove (id_type node) |
| remove an entire branch at once: ie remove the children and the node itself More... | |
| void | remove_children (id_type node) |
| remove all the node's children, but keep the node itself More... | |
| void | move (id_type node, id_type after) |
| change the node's position in the parent More... | |
| void | move (id_type node, id_type new_parent, id_type after) |
| change the node's parent and position More... | |
| id_type | move (Tree *src, id_type node, id_type new_parent, id_type after) |
| change the node's parent and position to a different tree More... | |
| void | set_root_as_stream () |
| ensure the first node is a stream. More... | |
| bool | change_type (id_type node, NodeType type) |
| bool | change_type (id_type node, type_bits type) |
| id_type | duplicate (id_type node, id_type new_parent, id_type after) |
| recursively duplicate a node from this tree into a new parent, placing it after one of its children More... | |
| id_type | duplicate (Tree const *src, id_type node, id_type new_parent, id_type after) |
| recursively duplicate a node from a different tree into a new parent, placing it after one of its children More... | |
| id_type | duplicate_children (id_type node, id_type parent, id_type after) |
| recursively duplicate the node's children (but not the node) More... | |
| id_type | duplicate_children (Tree const *src, id_type node, id_type parent, id_type after) |
| recursively duplicate the node's children (but not the node), where the node is from a different tree More... | |
| id_type | duplicate_children_no_rep (id_type node, id_type parent, id_type after) |
| duplicate the node's children (but not the node) in a new parent, but omit repetitions where a duplicated node has the same key (in maps) or value (in seqs). More... | |
| id_type | duplicate_children_no_rep (Tree const *src, id_type node, id_type parent, id_type after) |
| void | duplicate_contents (id_type node, id_type where) |
| void | duplicate_contents (Tree const *src, id_type node, id_type where) |
| void | merge_with (Tree const *src, id_type src_node=NONE, id_type dst_root=NONE) |
internal string arena | |
| size_t | arena_size () const |
| get the current size of the tree's internal arena More... | |
| size_t | arena_capacity () const |
| get the current capacity of the tree's internal arena More... | |
| size_t | arena_slack () const |
| get the current slack of the tree's internal arena More... | |
| size_t | arena_pos () const |
| csubstr | arena () const |
| get the current arena More... | |
| substr | arena () |
| get the current arena More... | |
| csubstr | arena_rem () const |
| get the free space at the end of the arena More... | |
| substr | arena_rem () |
| get the free space at the end of the arena More... | |
| bool | in_arena (csubstr s) const |
| return true if the given substring is part of the tree's string arena More... | |
| template<class T > | |
| csubstr | to_arena (T const &a) |
| serialize the given variable to the tree's arena, growing it as needed to accomodate the serialization. More... | |
| substr | copy_to_arena (csubstr s) |
| copy the given string to the tree's arena, growing the arena by the required size. More... | |
| substr | alloc_arena (size_t sz) |
| grow the tree's string arena by the given size and return a substr of the added portion More... | |
| void | reserve_arena (size_t arena_cap=RYML_DEFAULT_TREE_ARENA_CAPACITY) |
| ensure the tree's internal string arena is at least the given capacity More... | |
lookup | |
| lookup_result | lookup_path (csubstr path, id_type start=NONE) const |
| for example foo.bar[0].baz More... | |
| id_type | lookup_path_or_modify (csubstr default_value, csubstr path, id_type start=NONE) |
defaulted lookup: lookup path; if the lookup fails, recursively modify the tree so that the corresponding lookup_path() would return the default value. More... | |
| id_type | lookup_path_or_modify (Tree const *src, id_type src_node, csubstr path, id_type start=NONE) |
defaulted lookup: lookup path; if the lookup fails, recursively modify the tree so that the corresponding lookup_path() would return the branch src_node (from the tree src). More... | |
Public Attributes | |
| NodeData * | m_buf |
| id_type | m_cap |
| id_type | m_size |
| id_type | m_free_head |
| id_type | m_free_tail |
| substr | m_arena |
| size_t | m_arena_pos |
| Callbacks | m_callbacks |
| TagDirectives | m_tag_directives |
deserialization - checked | |
These methods raise an error if the deserialization failed or optionally if the node is not readable. | |
| template<class T > | |
| void | load (id_type node, 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 (see Read from Tree). More... | |
| template<class Wrapper > | |
| void | load (id_type node, Wrapper const &w, 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 (id_type node, 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 (see Read from ConstNodeRef). More... | |
| template<class Wrapper > | |
| void | load_key (id_type node, Wrapper const &w, bool check_readable=true) const |
| (2) like (1), but for wrapper tag types such as c4::fmt::base64() More... | |
| static ReadResult | to_result_ (bool, id_type node) noexcept |
| static ReadResult | to_result_ (ReadResult notlegacy, id_type) noexcept |
locations | |
| Location | location (Parser const &p, id_type node) const |
| Get the location of a node from the parse used to parse this tree. More... | |
|
inline |
Definition at line 314 of file tree.hpp.
| c4::yml::Tree::Tree | ( | Callbacks const & | cb | ) |
Definition at line 119 of file tree.cpp.
|
inline |
Definition at line 316 of file tree.hpp.
Definition at line 124 of file tree.cpp.
| void c4::yml::Tree::reserve | ( | id_type | node_capacity = RYML_DEFAULT_TREE_CAPACITY | ) |
Definition at line 292 of file tree.cpp.
Referenced by sample_global_allocator(), sample_parse_reuse_tree(), sample_parse_reuse_tree_and_parser(), and Tree().
| void c4::yml::Tree::clear | ( | ) |
clear the tree and zero every node
Definition at line 330 of file tree.cpp.
Referenced by sample_empty_null_values(), sample_parse_reuse_tree(), and sample_parse_reuse_tree_and_parser().
|
inline |
Definition at line 340 of file tree.hpp.
Referenced by sample_empty_null_values(), and sample_parse_reuse_tree().
|
inline |
Query for zero size.
The tree can be empty only when constructed with explicitly zero-capacity.
Definition at line 343 of file tree.hpp.
Referenced by c4::yml::Emitter< Writer >::emit_as(), normalize_tags(), normalize_tags_long(), c4::yml::operator<<(), and resolve_tags().
|
inline |
|
inline |
Definition at line 346 of file tree.hpp.
Referenced by c4::yml::Emitter< Writer >::emit_as(), and c4::yml::EventHandlerTree::reset().
|
inline |
Definition at line 349 of file tree.hpp.
Referenced by c4::yml::Emitter< Writer >::emit_as(), c4::yml::EventHandlerTree::reset(), resolve_tag(), resolve_tags(), sample_docs(), sample_error_visit_location(), and sample_quick_overview().
|
inline |
An if-less form of get() that demands a valid node index. This function is implementation only; use at your own risk.
Definition at line 380 of file tree.hpp.
Referenced by change_type(), clear_style(), find_child(), merge_with(), c4::yml::read(), c4::yml::read_key(), set_root_as_stream(), and set_style_conditionally().
|
inline |
Get the id of the root node. The tree must not be empty. The tree can be empty only when constructed with explicitly zero-capacity.
Definition at line 386 of file tree.hpp.
Referenced by c4::yml::Emitter< Writer >::emit_as(), lookup_path(), merge_with(), normalize_tags(), normalize_tags_long(), c4::yml::operator<<(), c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::yml::parse_json_in_arena(), c4::yml::parse_json_in_place(), reorder(), sample_docs(), sample_emit_to_container(), sample_emit_to_file(), sample_quick_overview(), sample_user_container_types(), and set_root_as_stream().
|
inline |
Get the id of the root node, or NONE if the tree is empty.
Definition at line 388 of file tree.hpp.
Referenced by c4::yml::emitrs_json(), and c4::yml::emitrs_yaml().
get the id of a node belonging to this tree. n can be nullptr, in which case NONE is returned n must belong to this tree
Definition at line 392 of file tree.hpp.
Referenced by sample_error_visit(), sample_error_visit_location(), sample_serialize_basic(), and set_root_as_stream().
| ConstNodeRef c4::yml::Tree::ref | ( | id_type | node | ) | const |
| ConstNodeRef c4::yml::Tree::cref | ( | id_type | node | ) | const |
| NodeRef c4::yml::Tree::rootref | ( | ) |
Get the root as a NodeRef . Note that a non-const Tree implicitly converts to NodeRef.
Definition at line 56 of file tree.cpp.
Referenced by sample_anchors_and_aliases_create(), sample_base64(), sample_docs(), sample_empty_null_values(), sample_float_precision(), sample_json(), sample_location_tracking(), sample_parse_reuse_tree(), sample_parse_style(), sample_quick_overview(), sample_std_types(), sample_style(), sample_style_flow_formatting(), sample_style_flow_ml_indent(), sample_tags(), and sample_tree_arena().
| ConstNodeRef c4::yml::Tree::rootref | ( | ) | const |
Get the root as a ConstNodeRef . Note that Tree implicitly converts to ConstNodeRef.
Definition at line 60 of file tree.cpp.
| ConstNodeRef c4::yml::Tree::crootref | ( | ) | const |
Get the root as a ConstNodeRef . Note that Tree implicitly converts to ConstNodeRef.
Definition at line 65 of file tree.cpp.
Referenced by sample_iterate_tree(), sample_parse_in_arena(), sample_parse_in_place(), and sample_parse_reuse_tree().
get the i-th document of the stream
i is NOT the node id, but the doc position within the stream Definition at line 104 of file tree.cpp.
Referenced by sample_docs().
| ConstNodeRef c4::yml::Tree::docref | ( | id_type | i | ) | const |
get the i-th document of the stream
i is NOT the node id, but the doc position within the stream Definition at line 108 of file tree.cpp.
| ConstNodeRef c4::yml::Tree::cdocref | ( | id_type | i | ) | const |
get the i-th document of the stream
i is NOT the node id, but the doc position within the stream Definition at line 112 of file tree.cpp.
find a root child (ie child of root) by name, return it as a NodeRef
Definition at line 86 of file tree.cpp.
| ConstNodeRef c4::yml::Tree::operator[] | ( | csubstr | key | ) | const |
find a root child (ie child of root) by name, return it as a NodeRef
Definition at line 90 of file tree.cpp.
find a root child (ie child of root) by index: return the root node's i-th child as a NodeRef
i is NOT the node id, but the child's position within the parent Definition at line 95 of file tree.cpp.
| ConstNodeRef c4::yml::Tree::operator[] | ( | id_type | i | ) | const |
find a root child (ie child of root) by index: return the root node's i-th child as a NodeRef
i is NOT the node id, but the child's position within the parent Definition at line 99 of file tree.cpp.
Definition at line 452 of file tree.hpp.
Referenced by change_type(), duplicate_children_no_rep(), merge_with(), and set_root_as_stream().
Definition at line 454 of file tree.hpp.
Referenced by duplicate_children_no_rep(), merge_with(), sample_quick_overview(), and sample_tree_arena().
Definition at line 455 of file tree.hpp.
Definition at line 456 of file tree.hpp.
Definition at line 457 of file tree.hpp.
|
inline |
Definition at line 458 of file tree.hpp.
Definition at line 460 of file tree.hpp.
Referenced by c4::yml::read(), sample_base64(), sample_docs(), and sample_tree_arena().
Definition at line 461 of file tree.hpp.
Definition at line 462 of file tree.hpp.
Definition at line 463 of file tree.hpp.
|
inline |
Definition at line 464 of file tree.hpp.
Definition at line 473 of file tree.hpp.
Definition at line 474 of file tree.hpp.
Definition at line 475 of file tree.hpp.
|
inline |
Definition at line 477 of file tree.hpp.
Referenced by sample_docs().
|
inline |
Definition at line 478 of file tree.hpp.
Referenced by sample_docs().
|
inline |
Definition at line 479 of file tree.hpp.
|
inline |
Definition at line 480 of file tree.hpp.
Referenced by c4::yml::read(), read(), c4::yml::EventHandlerTree::reset(), sample_docs(), and sample_quick_overview().
|
inline |
Definition at line 481 of file tree.hpp.
Referenced by c4::yml::read(), read(), sample_docs(), and sample_quick_overview().
|
inline |
Definition at line 482 of file tree.hpp.
Referenced by merge_with(), and c4::yml::EventHandlerTree::reset().
|
inline |
Definition at line 483 of file tree.hpp.
|
inline |
Definition at line 484 of file tree.hpp.
|
inline |
Definition at line 485 of file tree.hpp.
|
inline |
Definition at line 486 of file tree.hpp.
|
inline |
Definition at line 487 of file tree.hpp.
|
inline |
Definition at line 488 of file tree.hpp.
|
inline |
Definition at line 489 of file tree.hpp.
|
inline |
Definition at line 490 of file tree.hpp.
|
inline |
Definition at line 491 of file tree.hpp.
|
inline |
Definition at line 492 of file tree.hpp.
|
inline |
Definition at line 493 of file tree.hpp.
|
inline |
Definition at line 495 of file tree.hpp.
|
inline |
Definition at line 496 of file tree.hpp.
true when the node has an anchor named a
Definition at line 499 of file tree.hpp.
|
inline |
true if the node key is empty, or its scalar verifies scalar_is_null().
Definition at line 504 of file tree.hpp.
|
inline |
true if the node val is empty, or its scalar verifies scalar_is_null().
Definition at line 508 of file tree.hpp.
|
inline |
true if the key was a scalar requiring filtering and was left unfiltered during the parsing (see ParserOptions)
Definition at line 512 of file tree.hpp.
|
inline |
true if the val was a scalar requiring filtering and was left unfiltered during the parsing (see ParserOptions)
Definition at line 515 of file tree.hpp.
|
inline |
Definition at line 517 of file tree.hpp.
|
inline |
Definition at line 518 of file tree.hpp.
|
inline |
Definition at line 519 of file tree.hpp.
|
inline |
Definition at line 520 of file tree.hpp.
|
inline |
Definition at line 529 of file tree.hpp.
Referenced by depth_asc(), duplicate(), move(), c4::yml::EventHandlerTree::reset(), and sample_docs().
|
inline |
Definition at line 531 of file tree.hpp.
true when ancestor is parent or parent of a parent of node
Definition at line 1304 of file tree.cpp.
Referenced by duplicate_children_no_rep().
|
inline |
true when key and val are empty, and has no children
Definition at line 537 of file tree.hpp.
true if node has a child with id ch
Definition at line 540 of file tree.hpp.
Referenced by duplicate_children(), and duplicate_children_no_rep().
true if node has a child with key key
Definition at line 542 of file tree.hpp.
|
inline |
true if node has any children
Definition at line 544 of file tree.hpp.
Referenced by merge_with(), and set_root_as_stream().
true if node has a sibling with id sib
Definition at line 547 of file tree.hpp.
Referenced by move().
true if one of the node's siblings has the given key
Definition at line 549 of file tree.hpp.
|
inline |
true if node is not a single child
Definition at line 551 of file tree.hpp.
Definition at line 569 of file tree.hpp.
Referenced by depth_asc(), duplicate_children_no_rep(), is_ancestor(), move(), and c4::yml::EventHandlerTree::reset().
Definition at line 571 of file tree.hpp.
Referenced by duplicate_children_no_rep().
Definition at line 572 of file tree.hpp.
Referenced by child(), child_pos(), duplicate_children(), duplicate_children_no_rep(), find_child(), merge_with(), num_children(), c4::yml::read(), read(), sample_docs(), sample_quick_overview(), and set_root_as_stream().
O(num_children)
Definition at line 1216 of file tree.cpp.
Referenced by sample_docs(), and sample_user_container_types().
Definition at line 1224 of file tree.cpp.
Definition at line 577 of file tree.hpp.
Referenced by child(), child_pos(), duplicate_children(), duplicate_children_no_rep(), find_child(), merge_with(), num_children(), c4::yml::read(), read(), sample_docs(), sample_quick_overview(), and set_root_as_stream().
Definition at line 578 of file tree.hpp.
Referenced by duplicate_contents().
find child by position, or NONE if there are less than pos children posi
Definition at line 1237 of file tree.cpp.
Referenced by sample_docs().
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 at line 1249 of file tree.cpp.
Referenced by merge_with(), sample_docs(), and sample_quick_overview().
|
inline |
Definition at line 582 of file tree.hpp.
|
inline |
like Tree::find_child(), but return a ReadResult with the status
Definition at line 584 of file tree.hpp.
O(num_siblings)
counts with this
Definition at line 588 of file tree.hpp.
does not count with this
Definition at line 590 of file tree.hpp.
Definition at line 591 of file tree.hpp.
Definition at line 592 of file tree.hpp.
Referenced by sample_quick_overview().
Definition at line 593 of file tree.hpp.
Definition at line 594 of file tree.hpp.
Definition at line 595 of file tree.hpp.
|
inline |
like Tree::sibling(), but return a ReadResult with the status
Definition at line 597 of file tree.hpp.
|
inline |
like Tree::find_sibling(), but return a ReadResult if with the status
Definition at line 599 of file tree.hpp.
O(log(num_tree_nodes)) get the ascending depth of the node: number of levels between root and node.
Definition at line 1292 of file tree.cpp.
gets the i document node index.
requires that the root node is a stream.
Definition at line 605 of file tree.hpp.
Referenced by sample_docs().
get the document which is a parent document of node i, or the root if the tree is not a stream
Definition at line 608 of file tree.hpp.
|
inline |
Definition at line 628 of file tree.hpp.
|
inline |
Definition at line 629 of file tree.hpp.
|
inline |
Definition at line 630 of file tree.hpp.
|
inline |
Definition at line 632 of file tree.hpp.
|
inline |
Definition at line 633 of file tree.hpp.
|
inline |
Definition at line 634 of file tree.hpp.
|
inline |
Definition at line 635 of file tree.hpp.
|
inline |
Definition at line 636 of file tree.hpp.
|
inline |
Definition at line 637 of file tree.hpp.
|
inline |
Definition at line 639 of file tree.hpp.
|
inline |
Definition at line 640 of file tree.hpp.
|
inline |
Definition at line 641 of file tree.hpp.
|
inline |
Definition at line 642 of file tree.hpp.
|
inline |
Definition at line 643 of file tree.hpp.
|
inline |
Definition at line 644 of file tree.hpp.
|
inline |
Definition at line 645 of file tree.hpp.
|
inline |
Definition at line 646 of file tree.hpp.
|
inline |
Definition at line 647 of file tree.hpp.
|
inline |
Definition at line 648 of file tree.hpp.
|
inline |
Definition at line 649 of file tree.hpp.
|
inline |
Definition at line 650 of file tree.hpp.
|
inline |
Definition at line 651 of file tree.hpp.
|
inline |
Definition at line 652 of file tree.hpp.
|
inline |
Definition at line 653 of file tree.hpp.
Definition at line 655 of file tree.hpp.
Definition at line 656 of file tree.hpp.
Definition at line 658 of file tree.hpp.
Referenced by sample_style_flow_ml_indent().
Definition at line 659 of file tree.hpp.
Definition at line 660 of file tree.hpp.
| void c4::yml::Tree::clear_style | ( | id_type | node, |
| bool | recurse = false |
||
| ) |
Definition at line 1404 of file tree.cpp.
Referenced by sample_style().
| void c4::yml::Tree::set_style_conditionally | ( | id_type | node, |
| NodeType | type_mask, | ||
| NodeType | rem_style_flags, | ||
| NodeType | add_style_flags, | ||
| bool | recurse = false |
||
| ) |
Definition at line 1414 of file tree.cpp.
Referenced by sample_style().
|
inline |
Definition at line 675 of file tree.hpp.
|
inline |
Definition at line 682 of file tree.hpp.
Definition at line 688 of file tree.hpp.
Referenced by lookup_path_or_modify(), sample_anchors_and_aliases_create(), sample_lightning_overview(), sample_tree_arena(), c4::yml::write(), and write().
Definition at line 696 of file tree.hpp.
Definition at line 705 of file tree.hpp.
Referenced by merge_with(), write(), and c4::yml::write_key().
Definition at line 712 of file tree.hpp.
|
inline |
Definition at line 720 of file tree.hpp.
Referenced by merge_with(), and write().
Definition at line 725 of file tree.hpp.
|
inline |
Definition at line 731 of file tree.hpp.
Referenced by merge_with(), c4::yml::write(), and write().
Definition at line 736 of file tree.hpp.
Definition at line 742 of file tree.hpp.
Referenced by sample_serialize_basic().
Definition at line 743 of file tree.hpp.
Referenced by sample_serialize_basic().
Definition at line 745 of file tree.hpp.
Referenced by sample_anchors_and_aliases_create(), and sample_serialize_basic().
Definition at line 746 of file tree.hpp.
Referenced by sample_anchors_and_aliases_create(), and sample_serialize_basic().
Definition at line 747 of file tree.hpp.
Definition at line 748 of file tree.hpp.
Referenced by sample_anchors_and_aliases_create().
|
inline |
Definition at line 750 of file tree.hpp.
|
inline |
Definition at line 751 of file tree.hpp.
|
inline |
Definition at line 752 of file tree.hpp.
|
inline |
Definition at line 753 of file tree.hpp.
|
inline |
|
inline |
Definition at line 772 of file tree.hpp.
Referenced by sample_serialize_basic(), and sample_user_container_types().
|
inline |
Definition at line 782 of file tree.hpp.
|
inline |
|
inline |
Definition at line 804 of file tree.hpp.
|
inline |
Definition at line 823 of file tree.hpp.
Referenced by sample_base64(), sample_empty_null_values(), sample_serialize_basic(), c4::yml::write(), and write().
|
inline |
Definition at line 829 of file tree.hpp.
|
inline |
Definition at line 837 of file tree.hpp.
Referenced by sample_serialize_basic(), c4::yml::write(), write(), and c4::yml::write_key().
|
inline |
Definition at line 843 of file tree.hpp.
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inline |
(1) deserialize the node's contents (val or container) to the given variable, forwarding to the user-overrideable read() function (see Read from Tree).
This function differs from Tree::deserialize() in that here the error callback is called if the deserialization failed, or (optionally) the node is not readable.
Definition at line 871 of file tree.hpp.
Referenced by sample_base64(), sample_error_visit(), sample_error_visit_location(), sample_fundamental_types(), sample_serialize_basic(), and sample_user_container_types().
|
inline |
(2) like (1), but for wrapper tag types such as c4::fmt::base64()
Definition at line 888 of file tree.hpp.
|
inline |
(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).
This function differs from Tree::deserialize_key() in that here the error callback is called if the deserialization failed, or (optionally) the node is not readable.
Definition at line 912 of file tree.hpp.
Referenced by sample_base64(), and sample_serialize_basic().
|
inline |
(2) like (1), but for wrapper tag types such as c4::fmt::base64()
Definition at line 929 of file tree.hpp.
|
inline |
(1) deserialize a node's contents to a variable
Definition at line 954 of file tree.hpp.
Referenced by c4::yml::read(), read(), sample_base64(), and sample_serialize_basic().
|
inline |
(2) like (1), but for a wrapper type like those used in tag functions
Definition at line 964 of file tree.hpp.
|
inline |
(1) deserialize a node's key to a variable
Definition at line 975 of file tree.hpp.
Referenced by c4::yml::read(), read(), and sample_serialize_basic().
|
inline |
|
inline |
(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.
Definition at line 1011 of file tree.hpp.
Referenced by read().
|
inline |
(2) like (1), but assign from fallback if no such child exists.
Definition at line 1021 of file tree.hpp.
|
inline |
(3) like (1), but for wrapper tag types such as c4::fmt::base64()
Definition at line 1031 of file tree.hpp.
|
inline |
(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.
Definition at line 1050 of file tree.hpp.
|
inline |
(2) like (1), but assign from fallback if no such child exists
Definition at line 1061 of file tree.hpp.
|
inline |
(3) like (1), but for wrapper tag types such as c4::fmt::base64()
Definition at line 1073 of file tree.hpp.
| void c4::yml::Tree::reorder | ( | ) |
reorder the tree in memory so that all the nodes are stored in a linear sequence when visited in depth-first order.
This will invalidate existing ids, since the node id is its position in the tree's node array.
Definition at line 573 of file tree.cpp.
| void c4::yml::Tree::resolve | ( | ReferenceResolver * | rr, |
| bool | clear_anchors = true |
||
| ) |
Resolve references (aliases <- anchors), by forwarding to ReferenceResolver::resolve(); refer to ReferenceResolver::resolve() for further details.
Definition at line 1206 of file tree.cpp.
Referenced by resolve(), sample_anchors_and_aliases(), and sample_anchors_and_aliases_create().
| void c4::yml::Tree::resolve | ( | bool | clear_anchors = true | ) |
Resolve references (aliases <- anchors), by forwarding to ReferenceResolver::resolve(); refer to ReferenceResolver::resolve() for further details.
This overload uses a throwaway resolver object.
Definition at line 1198 of file tree.cpp.
| void c4::yml::Tree::resolve_tags | ( | TagCache & | cache, |
| bool | all = true |
||
| ) |
Resolve tags in the tree such as "!!str" -> "<tag:yaml.org,2002:str>", "!foo" -> "<!foo>" and custom tags as well, ie tags of the form "!handle!tag" for which there is a corresponding "%TAG" directive.
| cache | an object of type TagCache to minimize memory usage by avoiding repeated instantiation of the resolved tags in the tree's arena. |
| all | if true, resolve all tags; if false resolve only custom tags, ie those that have a prefix such as "!m!tag" with a matching "\%TAG" directive |
Definition at line 1553 of file tree.cpp.
Referenced by sample_tag_directives().
| void c4::yml::Tree::normalize_tags | ( | ) |
Definition at line 1571 of file tree.cpp.
Referenced by sample_tags().
| void c4::yml::Tree::normalize_tags_long | ( | ) |
Definition at line 1578 of file tree.cpp.
Referenced by sample_tags().
Definition at line 1444 of file tree.cpp.
Referenced by sample_error_basic().
resolve the given tag, appearing at node_id.
Write the result into output.
Definition at line 1456 of file tree.cpp.
Wrapper for Tree::resolve_tag(), returning a substring.
Definition at line 1145 of file tree.hpp.
|
inline |
Definition at line 1151 of file tree.hpp.
create and insert a new child of parent.
insert after the (to-be) sibling after, which must be a child of parent. To insert as the first child, set after to NONE
Definition at line 1168 of file tree.hpp.
create and insert a node as the first child of parent
Definition at line 1178 of file tree.hpp.
create and insert a node as the last child of parent
Definition at line 1180 of file tree.hpp.
Referenced by merge_with(), set_root_as_stream(), c4::yml::write(), and write().
Definition at line 1181 of file tree.hpp.
create and insert a new sibling of n. insert after "after"
Definition at line 1191 of file tree.hpp.
create and insert a node as the first node of parent
Definition at line 1196 of file tree.hpp.
Definition at line 1197 of file tree.hpp.
|
inline |
remove an entire branch at once: ie remove the children and the node itself
Definition at line 1202 of file tree.hpp.
Referenced by move().
| void c4::yml::Tree::remove_children | ( | id_type | node | ) |
remove all the node's children, but keep the node itself
Definition at line 917 of file tree.cpp.
Referenced by change_type(), and merge_with().
change the node's position in the parent
Definition at line 817 of file tree.cpp.
Referenced by duplicate_children_no_rep(), c4::yml::NodeRef::move(), and set_root_as_stream().
change the node's parent and position to a different tree
Definition at line 843 of file tree.cpp.
| void c4::yml::Tree::set_root_as_stream | ( | ) |
ensure the first node is a stream.
Eg, change this tree
DOCMAP MAP KEYVAL KEYVAL SEQ VAL
to
STREAM DOCMAP MAP KEYVAL KEYVAL SEQ VAL
If the root is already a stream, this is a no-op.
Definition at line 855 of file tree.cpp.
Definition at line 940 of file tree.cpp.
recursively duplicate a node from this tree into a new parent, placing it after one of its children
Definition at line 960 of file tree.cpp.
Referenced by c4::yml::NodeRef::duplicate(), duplicate_children(), duplicate_children_no_rep(), and move().
| id_type c4::yml::Tree::duplicate | ( | Tree const * | src, |
| id_type | node, | ||
| id_type | new_parent, | ||
| id_type | after | ||
| ) |
recursively duplicate a node from a different tree into a new parent, placing it after one of its children
Definition at line 965 of file tree.cpp.
recursively duplicate the node's children (but not the node)
Definition at line 983 of file tree.cpp.
Referenced by duplicate(), c4::yml::NodeRef::duplicate_children(), and duplicate_contents().
| id_type c4::yml::Tree::duplicate_children | ( | Tree const * | src, |
| id_type | node, | ||
| id_type | parent, | ||
| id_type | after | ||
| ) |
recursively duplicate the node's children (but not the node), where the node is from a different tree
Definition at line 988 of file tree.cpp.
duplicate the node's children (but not the node) in a new parent, but omit repetitions where a duplicated node has the same key (in maps) or value (in seqs).
If one of the duplicated children has the same key (in maps) or value (in seqs) as one of the parent's children, the one that is placed closest to the end will prevail.
Definition at line 1020 of file tree.cpp.
| id_type c4::yml::Tree::duplicate_children_no_rep | ( | Tree const * | src, |
| id_type | node, | ||
| id_type | parent, | ||
| id_type | after | ||
| ) |
Definition at line 1025 of file tree.cpp.
Definition at line 1005 of file tree.cpp.
Definition at line 1010 of file tree.cpp.
| void c4::yml::Tree::merge_with | ( | Tree const * | src, |
| id_type | src_node = NONE, |
||
| id_type | dst_root = NONE |
||
| ) |
Definition at line 1121 of file tree.cpp.
Referenced by lookup_path_or_modify().
Get the location of a node from the parse used to parse this tree.
Definition at line 1913 of file tree.cpp.
Referenced by sample_error_visit_location(), and sample_location_tracking().
|
inline |
|
inline |
get the current capacity of the tree's internal arena
Definition at line 1311 of file tree.hpp.
Referenced by sample_tree_arena().
|
inline |
get the current slack of the tree's internal arena
Definition at line 1313 of file tree.hpp.
|
inline |
get the current arena
Definition at line 1317 of file tree.hpp.
Referenced by sample_empty_null_values(), sample_fundamental_types(), sample_quick_overview(), sample_tree_arena(), and sample_user_container_types().
|
inline |
get the current arena
Definition at line 1319 of file tree.hpp.
|
inline |
get the free space at the end of the arena
Definition at line 1322 of file tree.hpp.
Referenced by c4::yml::serialize_to_arena_scalar().
|
inline |
get the free space at the end of the arena
Definition at line 1324 of file tree.hpp.
|
inline |
return true if the given substring is part of the tree's string arena
Definition at line 1327 of file tree.hpp.
Referenced by sample_quick_overview().
|
inline |
serialize the given variable to the tree's arena, growing it as needed to accomodate the serialization.
Definition at line 1349 of file tree.hpp.
Referenced by sample_fundamental_types(), and sample_tree_arena().
copy the given string to the tree's arena, growing the arena by the required size.
Definition at line 1370 of file tree.hpp.
Referenced by sample_tree_arena().
|
inline |
grow the tree's string arena by the given size and return a substr of the added portion
Definition at line 1397 of file tree.hpp.
Referenced by sample_tree_arena().
|
inline |
ensure the tree's internal string arena is at least the given capacity
Definition at line 1409 of file tree.hpp.
Referenced by sample_global_allocator(), sample_parse_reuse_tree(), sample_tree_arena(), and Tree().
| Tree::lookup_result c4::yml::Tree::lookup_path | ( | csubstr | path, |
| id_type | start = NONE |
||
| ) | const |
for example foo.bar[0].baz
Definition at line 1608 of file tree.cpp.
| id_type c4::yml::Tree::lookup_path_or_modify | ( | csubstr | default_value, |
| csubstr | path, | ||
| id_type | start = NONE |
||
| ) |
defaulted lookup: lookup path; if the lookup fails, recursively modify the tree so that the corresponding lookup_path() would return the default value.
Definition at line 1621 of file tree.cpp.
| id_type c4::yml::Tree::lookup_path_or_modify | ( | Tree const * | src, |
| id_type | src_node, | ||
| csubstr | path, | ||
| id_type | start = NONE |
||
| ) |
defaulted lookup: lookup path; if the lookup fails, recursively modify the tree so that the corresponding lookup_path() would return the branch src_node (from the tree src).
Definition at line 1628 of file tree.cpp.
| NodeData* c4::yml::Tree::m_buf |
| id_type c4::yml::Tree::m_cap |
Definition at line 1677 of file tree.hpp.
Referenced by clear(), reserve(), and set_root_as_stream().
| id_type c4::yml::Tree::m_size |
| id_type c4::yml::Tree::m_free_head |
Definition at line 1680 of file tree.hpp.
Referenced by clear(), reserve(), and set_root_as_stream().
| id_type c4::yml::Tree::m_free_tail |
| substr c4::yml::Tree::m_arena |
Definition at line 1683 of file tree.hpp.
Referenced by resolve_tags(), and c4::yml::serialize_to_arena_str().
| size_t c4::yml::Tree::m_arena_pos |
Definition at line 1684 of file tree.hpp.
Referenced by c4::yml::serialize_to_arena_scalar().
| Callbacks c4::yml::Tree::m_callbacks |
Definition at line 1686 of file tree.hpp.
Referenced by add_tag_directive(), change_type(), child(), child_pos(), clear(), depth_asc(), depth_desc(), duplicate(), duplicate_children(), duplicate_children_no_rep(), duplicate_contents(), c4::yml::detail::RoNodeMethods< NodeRef, ConstNodeRef >::err_visit_(), find_child(), is_ancestor(), merge_with(), move(), operator=(), remove_children(), reserve(), and set_root_as_stream().
| TagDirectives c4::yml::Tree::m_tag_directives |