TreeNode::GetArrayAsString

 

Version

Description

Get array as string from the node

Syntax

BOOL GetArrayAsString( string & strVal, DWORD dwCntrl = TREEGETARRAYASSTRING_DOTTED )

Parameters

strVal
[output] Output string value
dwCntrl
[input]
default: TREEGETARRAYASSTRING_DOTTED get the string like: 3:{1, 2, 3}
TREEGETARRAYASSTRING_DOTTED no total prefix of the stirng like: {1, 2, 3}

Return

Returns TRUE on success, FALSE on failure.

Examples

EX1

void TreeNode_GetArrayAsString_ex1()
{
    Tree tr;
    TreeNode trNode = tr.AddNode("node1",1);
    out_tree(tr);
    
    vector<int> vnVals = {1, 2, 3};
    trNode.nVals = vnVals;
    
    string    strArrayVal;
    if ( trNode.GetArrayAsString(strArrayVal, TREEGETARRAYASSTRING_NO_TOTAL_PREFIX) )
    {
        printf("The value is %s\n", strArrayVal);
    }
}

Remark

See Also

header to Included

origin.h