2.2.3.17.18 TreeNode::GetNodeText

Description

Get a node's text string by allowing custom code page value to convert from Unicode to multibytes. This is needed if the XML node contains a string that is not ascii. For example, Japanese, Chinese, or German strings.

Syntax

string GetNodeText( int nCodePage = -1 )

Parameters

nCodePage
[input] if >= 0, it will use this value as a code page to convert the Unicode string to Multibytes.

Return

A string (multibyte) from the XML node

Examples

EX1

void TreeNode_GetNodeText_ex1()
{
    Tree tr;
    TreeNode tn1;
    tn1 = tr.AddTextNode("abc", "Name", 1);	// tr add text node
    tn1.AddTextNode("def", "Addr", 11);		// tn1 add text node
    out_tree(tr);							// Output tr
    
    string strNode1Text = tn1.GetNodeText();// Get tn1 node text
    out_str(strNode1Text);					// Output node text
}

Remark

See Also

TreeNode::SetNodeText

Header to Include

origin.h