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

UnicodeSet & UnicodeSet::addAll ( const UnicodeSet c  )  [virtual]

Adds all of the elements in the specified set to this set if they're not already present. This operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress. A frozen set will not be modified.

Parameters:
c set whose elements are to be added to this set.
See also:
add(UChar32, UChar32) ICU 2.0
Adds all of the elements in the specified set to this set if they're not already present. This operation effectively modifies this set so that its value is the union of the two sets. The behavior of this operation is unspecified if the specified collection is modified while the operation is in progress.

Parameters:
c set whose elements are to be added to this set.
See also:
add(char, char)

Definition at line 1304 of file uniset.cpp.

References _add(), UVector::contains(), UVector::elementAt(), len, list, NULL, UVector::size(), and strings.

                                                  {
    if ( c.len>0 && c.list!=NULL ) {
        add(c.list, c.len, 0);
    }

    // Add strings in order
    if ( c.strings!=NULL ) {
        for (int32_t i=0; i<c.strings->size(); ++i) {
            const UnicodeString* s = (const UnicodeString*)c.strings->elementAt(i);
            if (!strings->contains((void*) s)) {
                _add(*s);
            }
        }
    }
    return *this;
}


Generated by  Doxygen 1.6.0   Back to index