Logo Search packages:      
Sourcecode: icu version File versions

Collator * RuleBasedCollator::safeClone ( void   ) [virtual]

Thread safe cloning operation.

Returns:
pointer to the new clone, user should remove it. ICU 2.2

Implements Collator.

Definition at line 564 of file tblcoll.cpp.

References FALSE, NULL, RuleBasedCollator(), TRUE, U_COL_SAFECLONE_BUFFERSIZE, U_FAILURE, U_ZERO_ERROR, and ucollator.

{
    UErrorCode intStatus = U_ZERO_ERROR;
    int32_t buffersize = U_COL_SAFECLONE_BUFFERSIZE;
    UCollator *ucol = ucol_safeClone(ucollator, NULL, &buffersize,
                                    &intStatus);
    if (U_FAILURE(intStatus)) {
        return NULL;
    }

    RuleBasedCollator *result = new RuleBasedCollator();
    // Null pointer check
    if (result != NULL) {
          result->ucollator = ucol;
          result->dataIsOwned = TRUE;
          result->isWriteThroughAlias = FALSE;
          setRuleStringFromCollator();
    }

    return result;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index