Function remove_child

Summary

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

(1) void remove_child(NodeRef &child)

(2) void remove_child(size_t pos)

(3) void remove_child(csubstr key)

Function overload

Synopsis

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

void remove_child(NodeRef &child)

Description

No description yet.

Source

Lines 608-615 in src/c4/yml/node.hpp.

inline void remove_child(NodeRef & child)
{
    _C4RV();
    RYML_ASSERT(has_child(child));
    RYML_ASSERT(child.parent().id() == id());
    m_tree->remove(child.id());
    child.clear();
}

Synopsis

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

void remove_child(size_t pos)

Description

remove the nth child of this node

Source

Lines 618-625 in src/c4/yml/node.hpp.

inline void remove_child(size_t pos)
{
    _C4RV();
    RYML_ASSERT(pos >= 0 && pos < num_children());
    size_t child = m_tree->child(m_id, pos);
    RYML_ASSERT(child != NONE);
    m_tree->remove(child);
}

Synopsis

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

void remove_child(csubstr key)

Description

remove a child by name

Source

Lines 628-634 in src/c4/yml/node.hpp.

inline void remove_child(csubstr key)
{
    _C4RV();
    size_t child = m_tree->find_child(m_id, key);
    RYML_ASSERT(child != NONE);
    m_tree->remove(child);
}





Add Discussion as Guest

Log in