DeleteTree
Deletes the tree referred to by name, lpcszName
BOOL DeleteTree( LPCSTR lpcszName )
Returns non zero if successful, else zero
EX1
//Deletes the tree referred to by name. void Project_DeleteTree_Ex1() { string strTreeName = "MyTree"; Tree tr; tr.SetAttribute(STR_LABEL_ATTRIB, strTreeName); tr.node1.nVal = 1234; tr.node2.strVal = "abcd"; int nTree = Project.AddTree(strTreeName, tr); vector<string> vsTreeNames; int nV = Project.GetTreeNames(vsTreeNames); if(!nV) { out_str("No tree in Project!"); return; } else { printf("Trees in the project :\n"); for(int ii=0; ii<nV; ii++) printf("(%d) %s\n", ii+1,vsTreeNames[ii]); } BOOL bRet = Project.DeleteTree(strTreeName); if(!bRet) { out_str("Error"); return; } out_str("\nDelete tree "+ strTreeName+"\n"); nV = Project.GetTreeNames(vsTreeNames); if(!nV) out_str("No tree in Project!"); else { printf("Trees in the project :\n"); for(int ii=0; ii<nV; ii++) printf("(%d) %s\n", ii+1,vsTreeNames[ii]); } return; }
Project::AddTree, Project::GetTree
origin.h