tree_get_enum_attribute_value

 

Description

Get a new value of an attribute, which doesn't duplicate any exist one, based on prefix and postfix string

Syntax

string tree_get_enum_attribute_value( TreeNode & trNode, string strAttribute, string strPrefix, string strPostfix = "" )

Parameters

trNode
[input] the tree node to get enumerating attribute value
strAttribute
[input] attribute string
strPrefix
[input] prefix string
strPostfix
[input] postfix string

Return

string of enumerating attribute value

Examples

EX1

void tree_get_enum_attribute_value_ex1()
{
        string strAttribute = "OriginLab";
        Tree trTest;
        TreeNode tnNum, tnStr, tnDouble;
        tnNum = trTest.AddNumericNode( 3 );
        tnNum.SetAttribute( strAttribute, "Text" );
        tnStr = trTest.AddTextNode( "Hehe" );
        tnStr.SetAttribute( strAttribute, "Text1" );
        tnDouble = trTest.AddNumericNode( 32.323 );
        tnDouble.SetAttribute( strAttribute, "Text2" );
        
        string strPrefix, strValue, strPostfix;
        strPrefix = "Text";
        strPostfix = "";
        strValue = tree_get_enum_attribute_value( trTest, strAttribute, strPrefix, strPostfix);
        //it should output "Text3"
        out_str(strValue);
}

Remark

See Also

Header to Include

origin.h

Reference