TreeNode::AddTextNode

Description

Creates a new node with the specified name, id and the string value and returns that node.

Syntax

TreeNode AddTextNode( LPCSTR strVal, LPCSTR Name = NULL, int nChildID = -1, BOOL bSetAsCDATA = FALSE, int nCodePage = -1 )

Parameters

strVal
[input]string contents of the node
Name
[input] the name of the new node to be added to the tree. The name string must be a valid C identifier name. A valid C Identifier name must begin with a letter and can contain only letters, numbers, and underscore characters.
nChildID
[input] the id of the new node to be added to the tree; NodeID will not be added if < 0
bSetAsCDATA
[optional]ensures that any string set to it will be preserved without modifications when saved into a file.
nCodePage
[input] if >= 0, it will use this value as a code page to convert the string to Unicode for storing inside the tree node.

Return

The newly added node.

Examples

EX1

void TreeNode_AddTextNode_ex1()
{
    Tree myTree;
    TreeNode tn1;    
    tn1 = myTree.AddTextNode("abcd", "node1", 1);
    out_tree(myTree);
}

Remark

See Also

TreeNode::AddNumericNode, TreeNode::AddNode

header to Include

origin.h