TreeNode::Reset

Description

Removes all the children and values of a node or a tree, and optionally all attributes

Syntax

void Reset( BOOL bKeepAttributes = false )

Parameters

bKeepAttributes
[Input]false, will remove the node's attributes as well

Return

Examples

EX1

void TreeNode_Reset_ex1()
{
    Tree tr;
    TreeNode tn1;
    tn1 = tr.AddTextNode("abc", "node1", 1);
    tr.SetAttribute("NodeID", 5); 
    out_tree(tr);
    
    tr.Reset(true);         //If true, the attribute ID is 5
    out_tree(tr);
    
    int ID;
    if ( tr.GetAttribute("NodeID", ID) )
        printf("the attribute ID is %d", ID);

}

Remark

See Also

TreeNode::IsEmpty

header to Include

origin.h