Function insert_sibling

Synopsis

#include <src/c4/yml/tree.hpp>

size_t insert_sibling(size_t node, size_t after)

Description

create and insert a new sibling of n. insert after "after"

Source

Lines 770-778 in src/c4/yml/tree.hpp.

inline size_t insert_sibling(size_t node, size_t after)
{
    RYML_ASSERT(node != NONE);
    RYML_ASSERT( ! is_root(node));
    RYML_ASSERT(parent(node) != NONE);
    RYML_ASSERT(after == NONE || (has_sibling(node, after) && has_sibling(after, node)));
    RYML_ASSERT(get(node) != nullptr);
    return insert_child(get(node)->m_parent, after);
}





Add Discussion as Guest

Log in