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

USearchAttributeValue SearchIterator::getAttribute ( USearchAttribute  attribute  )  const [inherited]

Gets the text searching attributes

Parameters:
attribute text attribute (enum USearchAttribute) to be retrieve
Returns:
text attribute value ICU 2.0

Definition at line 77 of file search.cpp.

References SearchIterator::m_search_, 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.

{
    switch (attribute) {
    case USEARCH_OVERLAP :
        return (m_search_->isOverlap == TRUE ? USEARCH_ON : USEARCH_OFF);
    case USEARCH_CANONICAL_MATCH :
        return (m_search_->isCanonicalMatch == TRUE ? USEARCH_ON : 
                                                                USEARCH_OFF);
    case USEARCH_ELEMENT_COMPARISON :
        {
            int16_t value = m_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;
            }
        }
    default :
        return USEARCH_DEFAULT;
    }
}


Generated by  Doxygen 1.6.0   Back to index