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

UnicodeSet & UnicodeSet::complement ( const UnicodeString s  ) 

Complement the specified string in this set. The set will not contain the specified string once the call returns.
Warning: you cannot add an empty string ("") to a UnicodeSet. A frozen set will not be modified.

Parameters:
s the string to complement
Returns:
this object, for chaining ICU 2.4
Complement the specified string in this set. The set will not contain the specified string once the call returns.
Warning: you cannot add an empty string ("") to a UnicodeSet.
Parameters:
s the string to complement
Returns:
this object, for chaining

Definition at line 1278 of file uniset.cpp.

References _add(), complement(), UVector::contains(), getSingleCP(), isBogus(), isFrozen(), UnicodeString::length(), releasePattern(), and UVector::removeElement().

                                                         {
    if (s.length() == 0 || isFrozen() || isBogus()) return *this;
    int32_t cp = getSingleCP(s);
    if (cp < 0) {
        if (strings->contains((void*) &s)) {
            strings->removeElement((void*) &s);
        } else {
            _add(s);
        }
        releasePattern();
    } else {
        complement((UChar32)cp, (UChar32)cp);
    }
    return *this;
}


Generated by  Doxygen 1.6.0   Back to index