2.1.26.27 tree_filter_by_attrib_find


Description

filter tree by attribute finding, this is faster than matching

Syntax

bool tree_filter_by_attrib_find( TreeNode & tr, int iUnitNodeID, LPCSTR lpcstrAttrib, LPCSTR lpcstrSub, bool bCaseSensitive = false, bool bMustBeginWith = false )

Parameters

tr
[modify] the tree to filter
iUnitNodeID
[input]tree node id
lpcstrAttrib
[input] attribute string
lpcstrSub
[input] the value of attribute
bCaseSensitive
[input]if case sensitive for finding string
bMustBeginWith
[input]true, attribute value must match lpcstrSub from the first character

Return

Always returns true; except tr is invalid, will return false.

Examples

EX1

int tree_filter_by_attrib_find_ex1()
{
    Tree tr;
    tr.Root.First.SetAttribute(STR_LABEL_ATTRIB, "aaa");
    tr.Root.First.DataID = 1;
    tr.Root.Second.SetAttribute(STR_LABEL_ATTRIB, "aaa bbb");
    tr.Root.Second.DataID = 2;
    
    tree_filter_by_attrib_find(tr, tr.Root.First.DataID, STR_LABEL_ATTRIB, "aaa", true, true);    
    
    return 1;
}

Remark

See Also

tree_filter_by_attrib_match

Header to Include

origin.h

Reference