Get tree node from the specified path
TreeNode GetNodeFromPath( LPCSTR lpcszPath, BOOL bAddIfNotThere = FALSE, BOOL bCaseSensitive = FALSE )
Returns the tree node from the path, if not found and bAddIfNOtThere = TRUE, return NULL
EX1
void TreeNode_GetNodeFromPath_ex1() { Tree tr; tr.branch.node1.nVal = 1; TreeNode trNode = tr.GetNodeFromPath("branch.Node1", FALSE, FALSE); if(trNode) { out_tree(trNode); } else { printf("can not get trNode"); } TreeNode trNode2 = tr.GetNodeFromPath("123Branch.Node2", FALSE, TRUE); if(trNode2) { out_tree(trNode2); } else { printf("can not get trNode2"); } TreeNode trNode3 = tr.GetNodeFromPath("branch.node2", TRUE, FALSE); if(trNode3) { out_tree(tr); out_tree(trNode3); } else { printf("can not get trNode3"); } }
origin.h