tree_copy_values

 

Description

Copy TreeNode values from source TreeNode to destination TreeNode

Syntax

int tree_copy_values( const TreeNode & trSrc, TreeNode & trDest, WORD wOptions = TREE_COPY_SKIP_HIDDEN | TREE_COPY_ATTRIB_ENABLE )

Parameters

trSrc
[Input]source TreeNode
trDest
[Modify]destination TreeNode
wOptions
[Input]TREE_COPY_SKIP_HIDDEN, skip hidden TreeNode;
TREE_COPY_ATTRIB_ENABLE, want to copy Enable attribute too

Return

count of copied TreeNode

Examples

EX1

void tree_copy_values_ex1()
{
    Tree trS;
    trS.Math.Score.dVal = 90.5;
    trS.Math.Bookname.strVal = "Math";
    trS.Math.Bookname.Show = 0;    
    
    Tree trD;
    trD.Math.Score.dVal = 100;
    trD.Math.Bookname.strVal = "Math 2";
    trD.English.Score.dVal = 100;
    
    tree_copy_values(trS, trD);
    out_tree(trD);
}

Remark

See Also

tree_copy_values_by_id

header to Include

origin.h

Reference