2.1.26.18 tree_append_children


Description

Append tr2 that tagname including the special prefix into tr1 with all children and all attributes

Syntax

int tree_append_children( TreeNode & tr1, const TreeNode & tr2, LPCSTR lpcszPrefix )

Parameters

tr1
[modify] the source treenode
tr2
[input] the append treenode
lpcszPrefix
[input] the prefix string

Return

number of the sub treenode of tr1 and tr2, and the tagname of the treenode contains prefix string

Examples

EX1

void tree_append_children_ex1()
{
	Tree tr1,tr2;
	string str,strPreFix="spring";
	tr2.spring.February.strVal="sprStrVal";
	tr2.Spring3.March.nVal=3;
	tr2.Spring4.April.nVal=4;
	out_tree(tr1);
	out_tree(tr2);
	
	int nn = tree_append_children(tr1, tr2, strPreFix);
	printf("nn = %d\n", nn);
	out_tree(tr1);
	out_tree(tr2);
}

Remark

See Also

Header to Include

origin.h

Reference