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

void UnicodeSet::_add ( const UnicodeString s  )  [private]

Adds the given string, in order, to 'strings'. The given string must have been checked by the caller to not be empty and to not already be in 'strings'.

Definition at line 1017 of file uniset.cpp.

References isBogus(), isFrozen(), NULL, setToBogus(), UVector::sortedInsert(), U_FAILURE, and U_ZERO_ERROR.

Referenced by add(), addAll(), complement(), and complementAll().

                                            {
    if (isFrozen() || isBogus()) {
        return;
    }
    UnicodeString* t = new UnicodeString(s);
    if (t == NULL) { // Check for memory allocation error.
        setToBogus();
        return;
    }
    UErrorCode ec = U_ZERO_ERROR;
    strings->sortedInsert(t, compareUnicodeString, ec);
    if (U_FAILURE(ec)) {
        setToBogus();
        delete t;
    }
}


Generated by  Doxygen 1.6.0   Back to index