|
| id_type | _claim () |
| | 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 () |
| | Tree (Tree const &that) |
| | Tree (Tree &&that) noexcept |
| Tree & | operator= (Tree const &that) |
| Tree & | operator= (Tree &&that) noexcept |
| void | reserve (id_type node_capacity=RYML_DEFAULT_TREE_CAPACITY) |
| void | clear () |
| | clear the tree and zero every node
|
| void | clear_arena () |
| bool | empty () const |
| id_type | size () const |
| id_type | capacity () const |
| id_type | slack () const |
| Callbacks const & | callbacks () const |
| void | callbacks (Callbacks const &cb) |
| id_type | id (NodeData const *n) const |
| | get the index of a node belonging to this tree. n can be nullptr, in which case NONE is returned
|
| NodeData * | get (id_type node) |
| | get a pointer to a node's NodeData. i can be NONE, in which case a nullptr is returned
|
| NodeData const * | get (id_type node) const |
| | get a pointer to a node's NodeData. i can be NONE, in which case a nullptr is returned.
|
| 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.
|
| 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.
|
| id_type | root_id () const |
| | Get the id of the root node. The tree must not be empty.
|
| NodeRef | ref (id_type node) |
| | Get a NodeRef of a node by id.
|
| ConstNodeRef | ref (id_type node) const |
| | Get a NodeRef of a node by id.
|
| ConstNodeRef | cref (id_type node) const |
| | Get a NodeRef of a node by id.
|
| NodeRef | rootref () |
| | Get the root as a NodeRef.
|
| ConstNodeRef | rootref () const |
| | Get the root as a ConstNodeRef.
|
| ConstNodeRef | crootref () const |
| | Get the root as a ConstNodeRef.
|
| NodeRef | docref (id_type i) |
| | get the i-th document of the stream
|
| ConstNodeRef | docref (id_type i) const |
| | get the i-th document of the stream
|
| ConstNodeRef | cdocref (id_type i) const |
| | get the i-th document of the stream
|
| NodeRef | operator[] (csubstr key) |
| | find a root child (ie child of root) by name, return it as a NodeRef
|
| ConstNodeRef | operator[] (csubstr key) const |
| | find a root child (ie child of root) by name, return it as a NodeRef
|
| 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
|
| 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
|
| NodeType | type (id_type node) const |
| const char * | type_str (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 |
| bool | type_has_any (id_type node, NodeType_e bits) const |
| bool | type_has_all (id_type node, NodeType_e bits) const |
| bool | type_has_none (id_type node, NodeType_e 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
|
| bool | key_is_null (id_type node) const |
| | true if the node key is empty, or its scalar verifies scalar_is_null().
|
| bool | val_is_null (id_type node) const |
| | true if the node val is empty, or its scalar verifies scalar_is_null().
|
| 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)
|
| 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)
|
| 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 |
| 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).
|
| 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 |
| id_type | find_child (id_type node, csubstr const &key) const |
| id_type | num_siblings (id_type node) const |
| | O(num_siblings).
|
| id_type | num_other_siblings (id_type node) const |
| | does not count with this
|
| 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 |
| 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.
|
| 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.
|
| id_type | doc (id_type i) const |
| | gets the i document node index.
|
| 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
|
| 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 (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, NodeType_e style) |
| void | set_key_style (id_type node, NodeType_e style) |
| void | set_val_style (id_type node, NodeType_e 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) |
| void | to_keyval (id_type node, csubstr key, csubstr val, type_bits more_flags=0) |
| void | to_map (id_type node, csubstr key, type_bits more_flags=0) |
| void | to_seq (id_type node, csubstr key, type_bits more_flags=0) |
| void | to_val (id_type node, csubstr val, type_bits more_flags=0) |
| void | to_map (id_type node, type_bits more_flags=0) |
| void | to_seq (id_type node, type_bits more_flags=0) |
| void | to_doc (id_type node, type_bits more_flags=0) |
| void | to_stream (id_type node, type_bits more_flags=0) |
| void | set_key (id_type node, csubstr key) |
| void | set_val (id_type node, csubstr val) |
| 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) |
| void | reorder () |
| | reorder the tree in memory so that all the nodes are stored in a linear sequence when visited in depth-first order.
|
| void | resolve (ReferenceResolver *rr, bool clear_anchors=true) |
| | Resolve references (aliases <- anchors), by forwarding to ReferenceResolver::resolve(); refer to ReferenceResolver::resolve() for further details.
|
| void | resolve (bool clear_anchors=true) |
| | Resolve references (aliases <- anchors), by forwarding to ReferenceResolver::resolve(); refer to ReferenceResolver::resolve() for further details.
|
| 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.
|
| 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.
|
| csubstr | resolve_tag_sub (substr output, csubstr tag, id_type node_id) const |
| | Wrapper for Tree::resolve_tag(), returning a substring.
|
| c4::yml::TagDirectiveRange | tag_directives () const |
| id_type | insert_child (id_type parent, id_type after) |
| | create and insert a new child of parent.
|
| id_type | prepend_child (id_type parent) |
| | create and insert a node as the first child of parent
|
| id_type | append_child (id_type parent) |
| | create and insert a node as the last child of parent
|
| 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"
|
| id_type | prepend_sibling (id_type node) |
| | create and insert a node as the first node of parent
|
| 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
|
| void | remove_children (id_type node) |
| | remove all the node's children, but keep the node itself
|
| bool | change_type (id_type node, NodeType type) |
| | change the type of the node to one of MAP, SEQ or VAL.
|
| bool | change_type (id_type node, type_bits type) |
| void | move (id_type node, id_type after) |
| | change the node's position in the parent
|
| void | move (id_type node, id_type new_parent, id_type after) |
| | change the node's parent and position
|
| 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
|
| void | set_root_as_stream () |
| | ensure the first node is a stream.
|
| 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
|
| 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
|
| id_type | duplicate_children (id_type node, id_type parent, id_type after) |
| | recursively duplicate the node's children (but not the node)
|
| 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
|
| 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).
|
| 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) |
| size_t | arena_size () const |
| | get the current size of the tree's internal arena
|
| size_t | arena_capacity () const |
| | get the current capacity of the tree's internal arena
|
| size_t | arena_slack () const |
| | get the current slack of the tree's internal arena
|
| size_t | arena_pos () const |
| csubstr | arena () const |
| | get the current arena
|
| substr | arena () |
| | get the current arena
|
| bool | in_arena (csubstr s) const |
| | return true if the given substring is part of the tree's string arena
|
| 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.
|
| substr | copy_to_arena (csubstr s) |
| | copy the given string to the tree's arena, growing the arena by the required size.
|
| substr | alloc_arena (size_t sz) |
| | grow the tree's string arena by the given size and return a substr of the added portion
|
| 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
|
| lookup_result | lookup_path (csubstr path, id_type start=NONE) const |
| | for example foo.bar[0].baz
|
| 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.
|
| 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).
|