Lines Matching refs:errorCode
152 const RuleBasedCollator *base, UErrorCode &errorCode)
160 if(U_FAILURE(errorCode)) { return; }
162 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
165 const CollationTailoring *root = CollationRoot::getRoot(errorCode);
166 if(U_FAILURE(errorCode)) { return; }
168 errorCode = U_UNSUPPORTED_ERROR;
173 errorCode = U_MEMORY_ALLOCATION_ERROR;
176 CollationDataReader::read(base->tailoring, bin, length, *t, errorCode);
177 if(U_FAILURE(errorCode)) { return; }
179 adoptTailoring(t.orphan(), errorCode);
200 RuleBasedCollator::adoptTailoring(CollationTailoring *t, UErrorCode &errorCode) {
201 if(U_FAILURE(errorCode)) {
208 errorCode = U_MEMORY_ALLOCATION_ERROR;
259 UErrorCode errorCode = U_ZERO_ERROR;
260 LocalPointer<UnicodeSet> thisTailored(getTailoredSet(errorCode));
261 LocalPointer<UnicodeSet> otherTailored(o.getTailoredSet(errorCode));
262 if(U_FAILURE(errorCode)) { return FALSE; }
277 UErrorCode errorCode = U_ZERO_ERROR;
278 LocalPointer<UnicodeSet> set(getTailoredSet(errorCode));
279 if(U_FAILURE(errorCode)) { return 0; }
303 RuleBasedCollator::getLocale(ULocDataLocaleType type, UErrorCode& errorCode) const {
304 if(U_FAILURE(errorCode)) {
314 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
320 RuleBasedCollator::internalGetLocaleID(ULocDataLocaleType type, UErrorCode &errorCode) const {
321 if(U_FAILURE(errorCode)) {
334 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
366 RuleBasedCollator::getTailoredSet(UErrorCode &errorCode) const {
367 if(U_FAILURE(errorCode)) { return NULL; }
370 errorCode = U_MEMORY_ALLOCATION_ERROR;
374 TailoredSet(tailored).forData(data, errorCode);
375 if(U_FAILURE(errorCode)) {
386 UBool addPrefixes, UErrorCode &errorCode) const {
387 if(U_FAILURE(errorCode)) { return; }
394 ContractionsAndExpansions(contractions, expansions, NULL, addPrefixes).forData(data, errorCode);
398 RuleBasedCollator::internalAddContractions(UChar32 c, UnicodeSet &set, UErrorCode &errorCode) const {
399 if(U_FAILURE(errorCode)) { return; }
400 ContractionsAndExpansions(&set, NULL, NULL, FALSE).forCodePoint(data, c, errorCode);
409 RuleBasedCollator::getAttribute(UColAttribute attr, UErrorCode &errorCode) const {
410 if(U_FAILURE(errorCode)) { return UCOL_DEFAULT; }
435 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
443 UErrorCode &errorCode) {
444 UColAttributeValue oldValue = getAttribute(attr, errorCode);
445 if(U_FAILURE(errorCode)) { return; }
459 errorCode = U_MEMORY_ALLOCATION_ERROR;
466 defaultSettings.options, errorCode);
469 ownedSettings->setAlternateHandling(value, defaultSettings.options, errorCode);
472 ownedSettings->setCaseFirst(value, defaultSettings.options, errorCode);
476 defaultSettings.options, errorCode);
480 defaultSettings.options, errorCode);
483 ownedSettings->setStrength(value, defaultSettings.options, errorCode);
488 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
492 ownedSettings->setFlag(CollationSettings::NUMERIC, value, defaultSettings.options, errorCode);
495 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
498 if(U_FAILURE(errorCode
508 RuleBasedCollator::setMaxVariable(UColReorderCode group, UErrorCode &errorCode) {
509 if(U_FAILURE(errorCode)) { return *this; }
517 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
534 errorCode = U_MEMORY_ALLOCATION_ERROR;
543 ownedSettings->setMaxVariable(value, defaultSettings.options, errorCode);
544 if(U_FAILURE(errorCode)) { return *this; }
561 RuleBasedCollator::getVariableTop(UErrorCode & /*errorCode*/) const {
566 RuleBasedCollator::setVariableTop(const UChar *varTop, int32_t len, UErrorCode &errorCode) {
567 if(U_FAILURE(errorCode)) { return 0; }
569 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
574 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
581 ce1 = ci.nextCE(errorCode);
582 ce2 = ci.nextCE(errorCode);
585 ce1 = ci.nextCE(errorCode);
586 ce2 = ci.nextCE(errorCode);
589 errorCode = U_CE_NOT_FOUND_ERROR;
592 setVariableTop((uint32_t)(ce1 >> 32), errorCode);
597 RuleBasedCollator::setVariableTop(const UnicodeString &varTop, UErrorCode &errorCode) {
598 return setVariableTop(varTop.getBuffer(), varTop.length(), errorCode);
602 RuleBasedCollator::setVariableTop(uint32_t varTop, UErrorCode &errorCode) {
603 if(U_FAILURE(errorCode)) { return; }
609 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
618 errorCode = U_MEMORY_ALLOCATION_ERROR;
622 getDefaultSettings().options, errorCode);
623 if(U_FAILURE(errorCode)) { return; }
637 UErrorCode &errorCode) const {
638 if(U_FAILURE(errorCode)) { return 0; }
640 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
646 errorCode = U_BUFFER_OVERFLOW_ERROR;
655 UErrorCode &errorCode) {
656 if(U_FAILURE(errorCode)) { return; }
658 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
673 errorCode = U_MEMORY_ALLOCATION_ERROR;
676 ownedSettings->copyReorderingFrom(defaultSettings, errorCode);
683 errorCode = U_MEMORY_ALLOCATION_ERROR;
686 ownedSettings->setReordering(*data, reorderCodes, length, errorCode);
699 UErrorCode &errorCode) const {
700 if(U_FAILURE(errorCode)) { return UCOL_EQUAL; }
702 right.getBuffer(), right.length(), errorCode);
707 int32_t length, UErrorCode &errorCode) const {
708 if(U_FAILURE(errorCode) || length == 0) { return UCOL_EQUAL; }
710 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
718 right.getBuffer(), rightLength, errorCode);
724 UErrorCode &errorCode) const {
725 if(U_FAILURE(errorCode)) { return UCOL_EQUAL; }
727 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
737 return doCompare(left, leftLength, right, rightLength, errorCode);
742 UErrorCode &errorCode) const {
743 if(U_FAILURE(errorCode)) { return UCOL_EQUAL; }
747 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
750 return doCompare(leftBytes, left.length(), rightBytes, right.length(), errorCode);
756 UErrorCode &errorCode) const {
757 if(U_FAILURE(errorCode)) { return UCOL_EQUAL; }
759 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
770 reinterpret_cast<const uint8_t *>(right), rightLength, errorCode);
854 UErrorCode errorCode = U_ZERO_ERROR;
855 const UChar *spanLimit = nfcImpl.makeFCD(text, textLimit, NULL, errorCode);
856 if(U_FAILURE(errorCode)) { return; }
864 if(buffer.init(str.length(), errorCode)) {
865 nfcImpl.makeFCD(spanLimit, textLimit, &buffer, errorCode);
868 if(U_SUCCESS(errorCode)) {
901 UErrorCode errorCode = U_ZERO_ERROR;
902 return u8ci.nextCodePoint(errorCode);
925 UErrorCode errorCode = U_ZERO_ERROR;
926 return uici.nextCodePoint(errorCode);
968 UErrorCode &errorCode) const {
969 // U_FAILURE(errorCode) checked by caller.
1052 result = CollationCompare::compareUpToQuaternary(leftIter, rightIter, *settings, errorCode);
1058 result = CollationCompare::compareUpToQuaternary(leftIter, rightIter, *settings, errorCode);
1061 if(result != UCOL_EQUAL || settings->getStrength() < UCOL_IDENTICAL || U_FAILURE(errorCode)) {
1087 UErrorCode &errorCode) const {
1088 // U_FAILURE(errorCode) checked by caller.
1179 result = CollationCompare::compareUpToQuaternary(leftIter, rightIter, *settings, errorCode);
1183 result = CollationCompare::compareUpToQuaternary(leftIter, rightIter, *settings, errorCode);
1186 if(result != UCOL_EQUAL || settings->getStrength() < UCOL_IDENTICAL || U_FAILURE(errorCode)) {
1215 UErrorCode &errorCode) const {
1216 if(U_FAILURE(errorCode) || &left == &right) { return UCOL_EQUAL; }
1251 result = CollationCompare::compareUpToQuaternary(leftIter, rightIter, *settings, errorCode);
1255 result = CollationCompare::compareUpToQuaternary(leftIter, rightIter, *settings, errorCode);
1257 if(result != UCOL_EQUAL || settings->getStrength() < UCOL_IDENTICAL || U_FAILURE(errorCode)) {
1278 UErrorCode &errorCode) const {
1279 return getCollationKey(s.getBuffer(), s.length(), key, errorCode);
1284 UErrorCode &errorCode) const {
1285 if(U_FAILURE(errorCode)) {
1289 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
1294 writeSortKey(s, length, sink, errorCode);
1295 if(U_FAILURE(errorCode)) {
1298 errorCode = U_MEMORY_ALLOCATION_ERROR;
1324 UErrorCode errorCode = U_ZERO_ERROR;
1325 writeSortKey(s, length, sink, errorCode);
1326 return U_SUCCESS(errorCode) ? sink.NumberOfBytesAppended() : 0;
1331 SortKeyByteSink &sink, UErrorCode &errorCode) const {
1332 if(U_FAILURE(errorCode)) { return; }
1340 errorCode);
1345 callback, TRUE, errorCode);
1348 writeIdenticalLevel(s, limit, sink, errorCode);
1356 SortKeyByteSink &sink, UErrorCode &errorCode) const {
1358 const UChar *nfdQCYesLimit = data->nfcImpl.decompose(s, limit, NULL, errorCode);
1359 if(U_FAILURE(errorCode)) { return; }
1376 data->nfcImpl.decompose(nfdQCYesLimit, limit, nfd, destLengthEstimate, errorCode);
1422 uint8_t *dest, int32_t count, UErrorCode &errorCode) const {
1423 if(U_FAILURE(errorCode)) { return 0; }
1425 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
1441 sink, level, callback, FALSE, errorCode);
1445 sink, level, callback, FALSE, errorCode);
1447 if(U_FAILURE(errorCode)) { return 0; }
1470 writeIdenticalLevel(sArray, sArray + s.length(), sink, errorCode);
1471 if(U_FAILURE(errorCode)) { return 0; }
1490 UErrorCode &errorCode) const {
1491 if(U_FAILURE(errorCode)) { return; }
1498 while((ce = iter.nextCE(errorCode)) != Collation::NO_CE) {
1499 ces.addElement(ce, errorCode);
1504 while((ce = iter.nextCE(errorCode)) != Collation::NO_CE) {
1505 ces.addElement(ce, errorCode);
1513 UErrorCode &errorCode) {
1514 if(U_FAILURE(errorCode) || length == 0) { return; }
1516 s.append('_', errorCode);
1518 s.append(letter, errorCode);
1520 s.append(uprv_toupper(subtag[i]), errorCode);
1525 UErrorCode &errorCode) {
1526 if(U_FAILURE(errorCode)) { return; }
1528 s.append('_', errorCode);
1531 s.append(letter, errorCode);
1532 s.append(valueChars[value], errorCode);
1540 UErrorCode &errorCode) const {
1541 if(U_FAILURE(errorCode)) { return 0; }
1543 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
1547 locale = internalGetLocaleID(ULOC_VALID_LOCALE, errorCode);
1553 NULL, &errorCode);
1554 if(U_FAILURE(errorCode)) { return 0; }
1566 appendAttribute(result, 'A', getAttribute(UCOL_ALTERNATE_HANDLING, errorCode), errorCode);
1571 appendAttribute(result, 'C', getAttribute(UCOL_CASE_FIRST, errorCode), errorCode);
1574 appendAttribute(result, 'D', getAttribute(UCOL_NUMERIC_COLLATION, errorCode), errorCode);
1577 appendAttribute(result, 'E', getAttribute(UCOL_CASE_LEVEL, errorCode), errorCode);
1580 appendAttribute(result, 'F', getAttribute(UCOL_FRENCH_COLLATION, errorCode), errorCode);
1583 length = uloc_getKeywordValue(resultLocale, "collation", subtag, UPRV_LENGTHOF(subtag), &errorCode);
1584 appendSubtag(result, 'K', subtag, length, errorCode);
1585 length = uloc_getLanguage(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
1586 appendSubtag(result, 'L', subtag, length, errorCode);
1588 appendAttribute(result, 'N', getAttribute(UCOL_NORMALIZATION_MODE, errorCode), errorCode);
1590 length = uloc_getCountry(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
1591 appendSubtag(result, 'R', subtag, length, errorCode);
1593 appendAttribute(result, 'S', getAttribute(UCOL_STRENGTH, errorCode), errorCode);
1595 length = uloc_getVariant(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
1596 appendSubtag(result, 'V', subtag, length, errorCode);
1597 length = uloc_getScript(resultLocale, subtag, UPRV_LENGTHOF(subtag), &errorCode);
1598 appendSubtag(result, 'Z', subtag, length, errorCode);
1600 if(U_FAILURE(errorCode)) { return 0; }
1604 return u_terminateChars(buffer, capacity, result.length(), &errorCode);
1613 RuleBasedCollator::computeMaxExpansions(const CollationTailoring *t, UErrorCode &errorCode) {
1614 t->maxExpansions = CollationElementIterator::computeMaxExpansions(t->data, errorCode);
1618 RuleBasedCollator::initMaxExpansions(UErrorCode &errorCode) const {
1619 umtx_initOnce(tailoring->maxExpansionsInitOnce, computeMaxExpansions, tailoring, errorCode);
1620 return U_SUCCESS(errorCode);
1625 UErrorCode errorCode = U_ZERO_ERROR;
1626 if(!initMaxExpansions(errorCode)) { return NULL; }
1627 CollationElementIterator *cei = new CollationElementIterator(source, this, errorCode);
1628 if(U_FAILURE(errorCode)) {
1637 UErrorCode errorCode = U_ZERO_ERROR;
1638 if(!initMaxExpansions(errorCode)) { return NULL; }
1639 CollationElementIterator *cei = new CollationElementIterator(source, this, errorCode);
1640 if(U_FAILURE(errorCode)) {
1649 UErrorCode errorCode = U_ZERO_ERROR;
1650 (void)initMaxExpansions(errorCode);