2.2.3.17.13 TreeNode::GetAttributeNames

Description

Get all the attribute names from this node

Syntax

BOOL GetAttributeNames( vector<string> & vsNames )

Parameters

vsNames
[output] Recieve all the attribute names

Return

TRUE if successful FALSE if fail

Examples

EX1

void TreeNode_GetAttributeNames_ex1()
{
    Tree tr;    
    // add node and "NodeID" attribute with integer value 2
    TreeNode tn1 = tr.AddTextNode("abc", "node1", 2); 
 
    // add more attributes
    tn1.SetAttribute("Label1", 5);                 
    tn1.SetAttribute("Label2", 6);
 
    // get and print out all attribute names
    vector<string> vsNames;
    tn1.GetAttributeNames(vsNames);
    for(int ii=0; ii<vsNames.GetSize(); ii++)
    {
        out_str(vsNames[ii]);
    }
}

Remark

See Also

TreeNode::GetAttribute, TreeNode::SetAttribute

Header to Include

origin.h