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

UnicodeSet & UnicodeSet::add ( const UnicodeString s  ) 

Adds the specified multicharacter to this set if it is not already present. If this set already contains the multicharacter, the call leaves this set unchanged. Thus "ch" => {"ch"}
Warning: you cannot add an empty string ("") to a UnicodeSet. A frozen set will not be modified.

Parameters:
s the source string
Returns:
this object, for chaining ICU 2.4
Adds the specified multicharacter to this set if it is not already present. If this set already contains the multicharacter, the call leaves this set unchanged. Thus "ch" => {"ch"}
Warning: you cannot add an empty string ("") to a UnicodeSet.
Parameters:
s the source string
Returns:
the modified set, for chaining

Definition at line 998 of file uniset.cpp.

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

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


Generated by  Doxygen 1.6.0   Back to index