Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_STABLE USearchAttributeValue U_EXPORT2 usearch_getAttribute ( const UStringSearch strsrch,
USearchAttribute  attribute 
)

Gets the text searching attributes.

Parameters:
strsrchsearch iterator data struct
attributetext attribute to be retrieve
Returns:
text attribute value
See also:
usearch_setAttribute ICU 2.4

Definition at line 2856 of file usearch.cpp.

References TRUE, USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD, USEARCH_CANONICAL_MATCH, USEARCH_DEFAULT, USEARCH_ELEMENT_COMPARISON, USEARCH_OFF, USEARCH_ON, USEARCH_OVERLAP, USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD, and USEARCH_STANDARD_ELEMENT_COMPARISON.

{
    if (strsrch) {
        switch (attribute) {
        case USEARCH_OVERLAP :
            return (strsrch->search->isOverlap == TRUE ? USEARCH_ON :
                                                        USEARCH_OFF);
        case USEARCH_CANONICAL_MATCH :
            return (strsrch->search->isCanonicalMatch == TRUE ? USEARCH_ON :
                                                               USEARCH_OFF);
        case USEARCH_ELEMENT_COMPARISON :
            {
                int16_t value = strsrch->search->elementComparisonType;
                if (value == USEARCH_PATTERN_BASE_WEIGHT_IS_WILDCARD || value == USEARCH_ANY_BASE_WEIGHT_IS_WILDCARD) {
                    return (USearchAttributeValue)value;
                } else {
                    return USEARCH_STANDARD_ELEMENT_COMPARISON;
                }
            }
        case USEARCH_ATTRIBUTE_COUNT :
            return USEARCH_DEFAULT;
        }
    }
    return USEARCH_DEFAULT;
}

Generated by  Doxygen 1.6.0   Back to index