Project::GetTreeNames

Description

Retrieves the names of the Trees in the manager

Syntax

int GetTreeNames( vector<string> & vsNames )

Parameters

vsNames
[output]receives the names of the Trees in the manager

Return

returns the number elements in the vector

Examples

EX1

void Project_GetTreeNames_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);
    nTree = Project.AddTree("MyTree2", tr);
    
    vector<string> vsTreeNames;
    int 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]);
    }
}

Remark

See Also

Project::DeleteTree

Header to Include

origin.h