2.2.3.17.20 TreeNode::ID

ClassName

TreeNode

AccessType

public

Name

ID

Declaration

int ID

Remark

Examples

EX1

void TreeNode_ID_ex1()
{
    Tree myTree1;
    TreeNode tn1, tn11, tn12, tnTmp;
    tn1 = myTree1.AddTextNode("abc", "Name", 1);
    tn11 = tn1.AddTextNode("def", "Addr", 11);
    tn12 = tn1.AddTextNode("ghi", "Mail", 12);
    out_tree(myTree1);
    /*
            myTree1
               |
            Name(abc)
           /        \
     Addr(def)  Mail(ghi)
    */
 	
	tnTmp = myTree1;
	while( tnTmp.IsValid() )
	{
		out_str(tnTmp.tagName + "'s ID = " + tnTmp.ID);
		if( tnTmp.NextNode.IsValid() )
			tnTmp = tnTmp.NextNode;		// Next brother
		else
			tnTmp = tnTmp.FirstNode;	// Children enumerating finished, try next child
	}
}

Description

attribute NodeID

Header to Include

origin.h

See Also

Reference