Logo Search packages:      
Sourcecode: icu version File versions

UBool UnicodeSet::contains ( UChar32  c ) const [virtual]

Returns true if this set contains the given character. This function works faster with a frozen set.

Parameters:
ccharacter to be checked for containment
Returns:
true if the test condition is met ICU 2.0

Returns true if this set contains the given character.

Parameters:
ccharacter to be checked for containment
Returns:
true if the test condition is met

Implements UnicodeFilter.

Definition at line 401 of file uniset.cpp.

References FALSE, findCodePoint(), and NULL.

Referenced by DecimalFormat::compareSimpleAffix(), contains(), containsAll(), KhmerBreakEngine::divideUpDictionaryRange(), ThaiBreakEngine::divideUpDictionaryRange(), RegexMatcher::find(), DictionaryBreakEngine::findBreaks(), DictionaryBreakEngine::handles(), NameUnicodeTransliterator::handleTransliterate(), NamePrepTransform::isLabelSeparator(), NamePrepTransform::map(), matches(), SimpleDateFormat::matchLiterals(), NamePrepTransform::process(), UnicodeSetTest::setToBits(), span(), spanBack(), spanBackUTF8(), spanUTF8(), UnicodeSetTest::TestCloseOver(), and uspoof_check().

                                          {
    // Set i to the index of the start item greater than ch
    // We know we will terminate without length test!
    // LATER: for large sets, add binary search
    //int32_t i = -1;
    //for (;;) {
    //    if (c < list[++i]) break;
    //}
    if (bmpSet != NULL) {
        return bmpSet->contains(c);
    }
    if (stringSpan != NULL) {
        return stringSpan->contains(c);
    }
    if (c >= UNICODESET_HIGH) { // Don't need to check LOW bound
        return FALSE;
    }
    int32_t i = findCodePoint(c);
    return (UBool)(i & 1); // return true if odd
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index