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

UBool UnicodeSet::containsAll ( const UnicodeSet c  )  const [virtual]

Returns true if this set contains all the characters and strings of the given set.

Parameters:
c set to be checked for containment
Returns:
true if the test condition is met ICU 2.4
Returns true if this set contains all the characters and strings of the given set.
Parameters:
c set to be checked for containment
Returns:
true if the test condition is met

Definition at line 504 of file uniset.cpp.

References contains(), UVector::containsAll(), FALSE, getRangeCount(), getRangeEnd(), getRangeStart(), strings, and TRUE.

Referenced by CollationAPITest::TestSubclass().

                                                       {
    // The specified set is a subset if all of its pairs are contained in
    // this set.  It's possible to code this more efficiently in terms of
    // direct manipulation of the inversion lists if the need arises.
    int32_t n = c.getRangeCount();
    for (int i=0; i<n; ++i) {
        if (!contains(c.getRangeStart(i), c.getRangeEnd(i))) {
            return FALSE;
        }
    }
    if (!strings->containsAll(*c.strings)) return FALSE;
    return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index