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

void UnicodeSet::setPattern ( const UnicodeString newPat  )  [private]

Set the new pattern to cache.

Definition at line 2072 of file uniset.cpp.

References UnicodeString::extractBetween(), UnicodeString::length(), pat, and releasePattern().

Referenced by applyPattern(), and operator=().

    int32_t newPatLen = newPat.length();
    pat = (UChar *)uprv_malloc((newPatLen + 1) * sizeof(UChar));
    if (pat) {
        patLen = newPatLen;
        newPat.extractBetween(0, patLen, pat);
        pat[patLen] = 0;
    // else we don't care if malloc failed. This was just a nice cache.
    // We can regenerate an equivalent pattern later when requested.

Generated by  Doxygen 1.6.0   Back to index