2.1.26.56 tree_node_copy_attribute


Description

Copy attribute from TreeNode trSrc to trDest

Syntax

bool tree_node_copy_attribute( const TreeNode & trSrc, TreeNode & trDest, LPCSTR lpcszAttribute )

Parameters

trSrc
[Input]source TreeNode
trDest
[Modify]destination TreeNode
lpcszAttribute
[Input]specify attribute name to copy

Return

true if trSrc has given attribute and is copied to trDest

Examples

EX1

void tree_node_copy_attribute_ex1()
{
    Tree tr;
    TreeNode trFirst = tr.AddNode("First");
    TreeNode trSecond = tr.AddNode("Second");
    trFirst.SetAttribute(STR_LABEL_ATTRIB, "All Nodes Label");
    
    bool bRet = tree_node_copy_attribute(trFirst, trSecond, STR_LABEL_ATTRIB);
    string strLabel;
    trSecond.GetAttribute(STR_LABEL_ATTRIB, strLabel);
    out_str(strLabel);
}

Remark

See Also

Header to Include

origin.h

Reference