Lines Matching full:errorcode
133 virtual UChar32 nextCodePoint(UErrorCode &errorCode);
134 virtual UChar32 previousCodePoint(UErrorCode &errorCode);
137 virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode);
138 virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode);
141 virtual uint32_t getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode);
177 UErrorCode errorCode = U_ZERO_ERROR;
178 while(U_SUCCESS(errorCode) && pos < s->length()) {
191 appendCEsFromCE32(d, c, ce32, /*forward=*/ TRUE, errorCode);
192 U_ASSERT(U_SUCCESS(errorCode));
218 DataBuilderCollationIterator::nextCodePoint(UErrorCode & /*errorCode*/) {
228 DataBuilderCollationIterator::previousCodePoint(UErrorCode & /*errorCode*/) {
238 DataBuilderCollationIterator::forwardNumCodePoints(int32_t num, UErrorCode & /*errorCode*/) {
243 DataBuilderCollationIterator::backwardNumCodePoints(int32_t num, UErrorCode & /*errorCode*/) {
253 DataBuilderCollationIterator::getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode) {
262 cond->builtCE32 = builder.buildContext(cond, errorCode);
263 if(errorCode == U_BUFFER_OVERFLOW_ERROR) {
264 errorCode = U_ZERO_ERROR;
266 cond->builtCE32 = builder.buildContext(cond, errorCode);
276 CollationDataBuilder::CollationDataBuilder(UErrorCode &errorCode)
277 : nfcImpl(*Normalizer2Factory::getNFCImpl(errorCode)),
280 ce32s(errorCode), ce64s(errorCode), conditionalCE32s(errorCode),
285 ce32s.addElement(0, errorCode);
296 CollationDataBuilder::initForTailoring(const CollationData *b, UErrorCode &errorCode) {
297 if(U_FAILURE(errorCode)) { return; }
299 errorCode = U_INVALID_STATE_ERROR;
303 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
309 trie = utrie2_open(Collation::FALLBACK_CE32, Collation::FFFD_CE32, &errorCode);
317 utrie2_set32(trie, c, Collation::FALLBACK_CE32, &errorCode);
325 utrie2_setRange32(trie, Hangul::HANGUL_BASE, Hangul::HANGUL_END, hangulCE32, TRUE, &errorCode);
331 if(U_FAILURE(errorCode)) { return; }
337 UErrorCode &errorCode) {
338 if(U_FAILURE(errorCode)) { return FALSE; }
356 int32_t index = addCE(dataCE, errorCode);
357 if(U_FAILURE(errorCode)) { return 0; }
359 errorCode = U_BUFFER_OVERFLOW_ERROR;
363 utrie2_setRange32(trie, start, end, offsetCE32, TRUE, &errorCode);
374 UErrorCode &errorCode) {
375 if(U_FAILURE(errorCode)) { return 0; }
377 if(maybeSetPrimaryRange(start, end, primary, step, errorCode)) {
383 utrie2_set32(trie, start, Collation::makeLongPrimaryCE32(primary), &errorCode);
421 CollationDataBuilder::getSingleCE(UChar32 c, UErrorCode &errorCode) const {
422 if(U_FAILURE(errorCode)) { return 0; }
437 errorCode = U_UNSUPPORTED_ERROR;
441 errorCode = U_INTERNAL_PROGRAM_ERROR;
453 errorCode = U_UNSUPPORTED_ERROR;
461 errorCode = U_UNSUPPORTED_ERROR;
485 CollationDataBuilder::addCE(int64_t ce, UErrorCode &errorCode) {
490 ce64s.addElement(ce, errorCode);
495 CollationDataBuilder::addCE32(uint32_t ce32, UErrorCode &errorCode) {
500 ce32s.addElement((int32_t)ce32, errorCode);
506 UErrorCode &errorCode) {
507 if(U_FAILURE(errorCode)) { return -1; }
511 errorCode = U_BUFFER_OVERFLOW_ERROR;
516 errorCode = U_MEMORY_ALLOCATION_ERROR;
519 conditionalCE32s.addElement(cond, errorCode);
526 UErrorCode &errorCode) {
527 uint32_t ce32 = encodeCEs(ces, cesLength, errorCode);
528 addCE32(prefix, s, ce32, errorCode);
533 uint32_t ce32, UErrorCode &errorCode) {
534 if(U_FAILURE(errorCode)) { return; }
536 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
540 errorCode = U_INVALID_STATE_ERROR;
554 oldCE32 = copyFromBaseCE32(c, baseCE32, TRUE, errorCode);
555 utrie2_set32(trie, c, oldCE32, &errorCode);
556 if(U_FAILURE(errorCode)) { return; }
562 utrie2_set32(trie, c, ce32, &errorCode);
573 int32_t index = addConditionalCE32(UnicodeString((UChar)0), oldCE32, errorCode);
574 if(U_FAILURE(errorCode)) { return; }
576 utrie2_set32(trie, c, contextCE32, &errorCode);
592 int32_t index = addConditionalCE32(context, ce32, errorCode);
593 if(U_FAILURE(errorCode)) { return; }
601 int32_t index = addConditionalCE32(context, ce32, errorCode);
602 if(U_FAILURE(errorCode)) { return; }
637 CollationDataBuilder::encodeOneCE(int64_t ce, UErrorCode &errorCode) {
641 int32_t index = addCE(ce, errorCode);
642 if(U_FAILURE(errorCode)) { return 0; }
644 errorCode = U_BUFFER_OVERFLOW_ERROR;
652 UErrorCode &errorCode) {
653 if(U_FAILURE(errorCode)) { return 0; }
655 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
659 errorCode = U_INVALID_STATE_ERROR;
667 return encodeOneCE(ces[0], errorCode);
689 return encodeExpansion32(newCE32s, cesLength, errorCode);
695 return encodeExpansion(ces, cesLength, errorCode);
699 CollationDataBuilder::encodeExpansion(const int64_t ces[], int32_t length, UErrorCode &errorCode) {
700 if(U_FAILURE(errorCode)) { return 0; }
707 errorCode = U_BUFFER_OVERFLOW_ERROR;
722 errorCode = U_BUFFER_OVERFLOW_ERROR;
726 ce64s.addElement(ces[j], errorCode);
733 UErrorCode &errorCode) {
734 if(U_FAILURE(errorCode)) { return 0; }
741 errorCode = U_BUFFER_OVERFLOW_ERROR;
756 errorCode = U_BUFFER_OVERFLOW_ERROR;
760 ce32s.addElement(newCE32s[j], errorCode);
767 UErrorCode &errorCode) {
768 if(U_FAILURE(errorCode)) { return 0; }
780 reinterpret_cast<const int32_t *>(baseCE32s), length, errorCode);
786 ce32 = encodeExpansion(baseCEs, length, errorCode);
795 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
801 index = copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
803 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
804 head.next = index = addConditionalCE32(context, ce32, errorCode);
806 if(U_FAILURE(errorCode)) { return 0; }
808 UCharsTrie::Iterator prefixes(p + 2, 0, errorCode);
809 while(prefixes.next(errorCode)) {
815 index = copyContractionsFromBaseCE32(context, c, ce32, cond, errorCode);
817 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
818 cond->next = index = addConditionalCE32(context, ce32, errorCode);
820 if(U_FAILURE(errorCode)) { return 0; }
831 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
835 copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
841 errorCode = U_UNSUPPORTED_ERROR; // We forbid tailoring of Hangul syllables.
847 ce32 = encodeOneCE(Collation::unassignedCEFromCodePoint(c), errorCode);
858 ConditionalCE32 *cond, UErrorCode &errorCode) {
859 if(U_FAILURE(errorCode)) { return 0; }
871 errorCode);
872 cond->next = index = addConditionalCE32(context, ce32, errorCode);
873 if(U_FAILURE(errorCode)) { return 0; }
878 UCharsTrie::Iterator suffixes(p + 2, 0, errorCode);
879 while(suffixes.next(errorCode)) {
881 ce32 = copyFromBaseCE32(c, (uint32_t)suffixes.getValue(), TRUE, errorCode);
882 cond->next = index = addConditionalCE32(context, ce32, errorCode);
883 if(U_FAILURE(errorCode)) { return 0; }
898 errorCode(initialErrorCode) {}
902 utrie2_setRange32(dest.trie, start, end, ce32, TRUE, &errorCode);
906 return U_SUCCESS(errorCode);
913 ce32 = dest.encodeOneCE(ce, errorCode);
943 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
946 reinterpret_cast<const int32_t *>(srcCE32s), length, errorCode);
973 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
975 ce32 = dest.encodeExpansion(srcCEs, length, errorCode);
982 cond->context, copyCE32(cond->ce32), errorCode);
988 cond->context, copyCE32(cond->ce32), errorCode);
1009 UErrorCode errorCode;
1025 UErrorCode &errorCode) {
1026 if(U_FAILURE(errorCode)) { return; }
1028 errorCode = U_INVALID_STATE_ERROR;
1031 CopyHelper helper(src, *this, modifier, errorCode);
1033 errorCode = helper.errorCode;
1041 CollationDataBuilder::optimize(const UnicodeSet &set, UErrorCode &errorCode) {
1042 if(U_FAILURE(errorCode) || set.isEmpty()) { return; }
1049 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
1050 utrie2_set32(trie, c, ce32, &errorCode);
1057 CollationDataBuilder::suppressContractions(const UnicodeSet &set, UErrorCode &errorCode) {
1058 if(U_FAILURE(errorCode) || set.isEmpty()) { return; }
1066 ce32 = copyFromBaseCE32(c, ce32, FALSE /* without context */, errorCode);
1067 utrie2_set32(trie, c, ce32, &errorCode);
1074 utrie2_set32(trie, c, ce32, &errorCode);
1082 CollationDataBuilder::getJamoCE32s(uint32_t jamoCE32s[], UErrorCode &errorCode) {
1083 if(U_FAILURE(errorCode)) { return FALSE; }
1130 errorCode = U_INTERNAL_PROGRAM_ERROR;
1141 /*withContext=*/ TRUE, errorCode);
1145 return anyJamoAssigned && U_SUCCESS(errorCode);
1149 CollationDataBuilder::setDigitTags(UErrorCode &errorCode) {
1150 UnicodeSet digits(UNICODE_STRING_SIMPLE("[:Nd:]"), errorCode);
1151 if(U_FAILURE(errorCode)) { return; }
1158 int32_t index = addCE32(ce32, errorCode);
1159 if(U_FAILURE(errorCode)) { return; }
1161 errorCode = U_BUFFER_OVERFLOW_ERROR;
1166 utrie2_set32(trie, c, ce32, &errorCode);
1196 CollationDataBuilder::setLeadSurrogates(UErrorCode &errorCode) {
1203 &errorCode);
1208 CollationDataBuilder::build(CollationData &data, UErrorCode &errorCode) {
1209 buildMappings(data, errorCode);
1216 buildFastLatinTable(data, errorCode);
1220 CollationDataBuilder::buildMappings(CollationData &data, UErrorCode &errorCode) {
1221 if(U_FAILURE(errorCode)) { return; }
1223 errorCode = U_INVALID_STATE_ERROR;
1227 buildContexts(errorCode);
1231 if(getJamoCE32s(jamoCE32s, errorCode)) {
1234 ce32s.addElement((int32_t)jamoCE32s[i], errorCode);
1258 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1268 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1273 setDigitTags(errorCode);
1274 setLeadSurrogates(errorCode);
1278 utrie2_set32(trie, 0, Collation::makeCE32FromTagAndIndex(Collation::U0000_TAG, 0), &errorCode);
1280 utrie2_freeze(trie, UTRIE2_32_VALUE_BITS, &errorCode);
1281 if(U_FAILURE(errorCode)) { return; }
1324 CollationDataBuilder::buildContexts(UErrorCode &errorCode) {
1325 if(U_FAILURE(errorCode)) { return; }
1330 while(U_SUCCESS(errorCode) && iter.next()) {
1336 errorCode = U_INTERNAL_PROGRAM_ERROR;
1340 ce32 = buildContext(cond, errorCode);
1341 utrie2_set32(trie, c, ce32, &errorCode);
1346 CollationDataBuilder::buildContext(ConditionalCE32 *head, UErrorCode &errorCode) {
1347 if(U_FAILURE(errorCode)) { return 0; }
1352 UCharsTrieBuilder prefixBuilder(errorCode);
1353 UCharsTrieBuilder contractionBuilder(errorCode);
1420 contractionBuilder.add(suffix, (int32_t)cond->ce32, errorCode);
1424 int32_t index = addContextTrie(emptySuffixCE32, contractionBuilder, errorCode);
1425 if(U_FAILURE(errorCode)) { return 0; }
1427 errorCode = U_BUFFER_OVERFLOW_ERROR;
1442 prefixBuilder.add(prefix, (int32_t)ce32, errorCode);
1447 int32_t index = addContextTrie(head->defaultCE32, prefixBuilder, errorCode);
1448 if(U_FAILURE(errorCode)) { return 0; }
1450 errorCode = U_BUFFER_OVERFLOW_ERROR;
1458 UErrorCode &errorCode) {
1462 context.append(trieBuilder.buildUnicodeString(USTRINGTRIE_BUILD_SMALL, trieString, errorCode));
1463 if(U_FAILURE(errorCode)) { return -1; }
1473 CollationDataBuilder::buildFastLatinTable(CollationData &data, UErrorCode &errorCode) {
1474 if(U_FAILURE(errorCode) || !fastLatinEnabled) { return; }
1477 fastLatinBuilder = new CollationFastLatinBuilder(errorCode);
1479 errorCode = U_MEMORY_ALLOCATION_ERROR;
1482 if(fastLatinBuilder->forData(data, errorCode)) {