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

void StringList::add ( const UnicodeString string,
UErrorCode status 

Add a string to the list.

string- the string to add
status- will be set if any errors occur.

ICU 4.0.1 technology preview

Definition at line 225 of file colldata.cpp.

References UnicodeString::append(), STRING_LIST_BUFFER_SIZE, and U_FAILURE.

Referenced by add().

    if (U_FAILURE(status)) {

    _strings += 1;

    if (listSize >= listMax) {
        int32_t newMax = listMax + STRING_LIST_BUFFER_SIZE;

        UnicodeString *newStrings = new UnicodeString[newMax];

        uprv_memcpy(newStrings, strings, listSize * sizeof(UnicodeString));

        int32_t _h = listSize / STRING_LIST_BUFFER_SIZE;

        if (_h > 100) {
            _h = 100;

        _histogram[_h] += 1;

        delete[] strings;
        strings = newStrings;
        listMax = newMax;

    // The ctor initialized all the strings in
    // the array to empty strings, so this
    // is the same as copying the source string.

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index