get TreeNode by ID matching
TreeNode tree_get_node_by_id( const TreeNode & tr, int nID, bool bRecursive = false )
Returns the TreeNode be found, invalid tree node if not found.
EX1
void tree_get_node_by_id_ex1() { Tree myTree; TreeNode tn1, tn2, tn3; tn1 = myTree.AddNode("Tom", 1); tn2 = myTree.AddTextNode("Girl", "Jane", 2); tn3 = tn2.AddTextNode("12", "Age", 3); TreeNode trAge; trAge = tree_get_node_by_id(myTree, 3, false); //trAge is invalid trAge = tree_get_node_by_id(myTree, 3, true); //trAge is valid here }
tree_get_node_by_dataid
origin.h