Lines Matching refs:errorCode
137 virtual UChar32 nextCodePoint(UErrorCode &errorCode);
138 virtual UChar32 previousCodePoint(UErrorCode &errorCode);
141 virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode);
142 virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode);
145 virtual uint32_t getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode);
181 UErrorCode errorCode = U_ZERO_ERROR;
182 while(U_SUCCESS(errorCode) && pos < s->length()) {
195 appendCEsFromCE32(d, c, ce32, /*forward=*/ TRUE, errorCode);
196 U_ASSERT(U_SUCCESS(errorCode));
222 DataBuilderCollationIterator::nextCodePoint(UErrorCode & /*errorCode*/) {
232 DataBuilderCollationIterator::previousCodePoint(UErrorCode & /*errorCode*/) {
242 DataBuilderCollationIterator::forwardNumCodePoints(int32_t num, UErrorCode & /*errorCode*/) {
247 DataBuilderCollationIterator::backwardNumCodePoints(int32_t num, UErrorCode & /*errorCode*/) {
257 DataBuilderCollationIterator::getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode) {
266 cond->builtCE32 = builder.buildContext(cond, errorCode);
267 if(errorCode == U_BUFFER_OVERFLOW_ERROR) {
268 errorCode = U_ZERO_ERROR;
270 cond->builtCE32 = builder.buildContext(cond, errorCode);
280 CollationDataBuilder::CollationDataBuilder(UErrorCode &errorCode)
281 : nfcImpl(*Normalizer2Factory::getNFCImpl(errorCode)),
284 ce32s(errorCode), ce64s(errorCode), conditionalCE32s(errorCode),
289 ce32s.addElement(0, errorCode);
300 CollationDataBuilder::initForTailoring(const CollationData *b, UErrorCode &errorCode) {
301 if(U_FAILURE(errorCode)) { return; }
303 errorCode = U_INVALID_STATE_ERROR;
307 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
313 trie = utrie2_open(Collation::FALLBACK_CE32, Collation::FFFD_CE32, &errorCode);
321 utrie2_set32(trie, c, Collation::FALLBACK_CE32, &errorCode);
329 utrie2_setRange32(trie, Hangul::HANGUL_BASE, Hangul::HANGUL_END, hangulCE32, TRUE, &errorCode);
335 if(U_FAILURE(errorCode)) { return; }
341 UErrorCode &errorCode) {
342 if(U_FAILURE(errorCode)) { return FALSE; }
360 int32_t index = addCE(dataCE, errorCode);
361 if(U_FAILURE(errorCode)) { return 0; }
363 errorCode = U_BUFFER_OVERFLOW_ERROR;
367 utrie2_setRange32(trie, start, end, offsetCE32, TRUE, &errorCode);
378 UErrorCode &errorCode) {
379 if(U_FAILURE(errorCode)) { return 0; }
381 if(maybeSetPrimaryRange(start, end, primary, step, errorCode)) {
387 utrie2_set32(trie, start, Collation::makeLongPrimaryCE32(primary), &errorCode);
425 CollationDataBuilder::getSingleCE(UChar32 c, UErrorCode &errorCode) const {
426 if(U_FAILURE(errorCode)) { return 0; }
442 errorCode = U_UNSUPPORTED_ERROR;
446 errorCode = U_INTERNAL_PROGRAM_ERROR;
458 errorCode = U_UNSUPPORTED_ERROR;
466 errorCode = U_UNSUPPORTED_ERROR;
490 CollationDataBuilder::addCE(int64_t ce, UErrorCode &errorCode) {
495 ce64s.addElement(ce, errorCode);
500 CollationDataBuilder::addCE32(uint32_t ce32, UErrorCode &errorCode) {
505 ce32s.addElement((int32_t)ce32, errorCode);
511 UErrorCode &errorCode) {
512 if(U_FAILURE(errorCode)) { return -1; }
516 errorCode = U_BUFFER_OVERFLOW_ERROR;
521 errorCode = U_MEMORY_ALLOCATION_ERROR;
524 conditionalCE32s.addElement(cond, errorCode);
531 UErrorCode &errorCode) {
532 uint32_t ce32 = encodeCEs(ces, cesLength, errorCode);
533 addCE32(prefix, s, ce32, errorCode);
538 uint32_t ce32, UErrorCode &errorCode) {
539 if(U_FAILURE(errorCode)) { return; }
541 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
545 errorCode = U_INVALID_STATE_ERROR;
559 oldCE32 = copyFromBaseCE32(c, baseCE32, TRUE, errorCode);
560 utrie2_set32(trie, c, oldCE32, &errorCode);
561 if(U_FAILURE(errorCode)) { return; }
567 utrie2_set32(trie, c, ce32, &errorCode);
578 int32_t index = addConditionalCE32(UnicodeString((UChar)0), oldCE32, errorCode);
579 if(U_FAILURE(errorCode)) { return; }
581 utrie2_set32(trie, c, contextCE32, &errorCode);
597 int32_t index = addConditionalCE32(context, ce32, errorCode);
598 if(U_FAILURE(errorCode)) { return; }
606 int32_t index = addConditionalCE32(context, ce32, errorCode);
607 if(U_FAILURE(errorCode)) { return; }
642 CollationDataBuilder::encodeOneCE(int64_t ce, UErrorCode &errorCode) {
646 int32_t index = addCE(ce, errorCode);
647 if(U_FAILURE(errorCode)) { return 0; }
649 errorCode = U_BUFFER_OVERFLOW_ERROR;
657 UErrorCode &errorCode) {
658 if(U_FAILURE(errorCode)) { return 0; }
660 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
664 errorCode = U_INVALID_STATE_ERROR;
672 return encodeOneCE(ces[0], errorCode);
694 return encodeExpansion32(newCE32s, cesLength, errorCode);
700 return encodeExpansion(ces, cesLength, errorCode);
704 CollationDataBuilder::encodeExpansion(const int64_t ces[], int32_t length, UErrorCode &errorCode) {
705 if(U_FAILURE(errorCode)) { return 0; }
712 errorCode = U_BUFFER_OVERFLOW_ERROR;
727 errorCode = U_BUFFER_OVERFLOW_ERROR;
731 ce64s.addElement(ces[j], errorCode);
738 UErrorCode &errorCode) {
739 if(U_FAILURE(errorCode)) { return 0; }
746 errorCode = U_BUFFER_OVERFLOW_ERROR;
761 errorCode = U_BUFFER_OVERFLOW_ERROR;
765 ce32s.addElement(newCE32s[j], errorCode);
772 UErrorCode &errorCode) {
773 if(U_FAILURE(errorCode)) { return 0; }
785 reinterpret_cast<const int32_t *>(baseCE32s), length, errorCode);
791 ce32 = encodeExpansion(baseCEs, length, errorCode);
800 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
806 index = copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
808 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
809 head.next = index = addConditionalCE32(context, ce32, errorCode);
811 if(U_FAILURE(errorCode)) { return 0; }
813 UCharsTrie::Iterator prefixes(p + 2, 0, errorCode);
814 while(prefixes.next(errorCode)) {
820 index = copyContractionsFromBaseCE32(context, c, ce32, cond, errorCode);
822 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
823 cond->next = index = addConditionalCE32(context, ce32, errorCode);
825 if(U_FAILURE(errorCode)) { return 0; }
836 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
840 copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
846 errorCode = U_UNSUPPORTED_ERROR; // We forbid tailoring of Hangul syllables.
852 ce32 = encodeOneCE(Collation::unassignedCEFromCodePoint(c), errorCode);
863 ConditionalCE32 *cond, UErrorCode &errorCode) {
864 if(U_FAILURE(errorCode)) { return 0; }
876 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
877 cond->next = index = addConditionalCE32(context, ce32, errorCode);
878 if(U_FAILURE(errorCode)) { return 0; }
883 UCharsTrie::Iterator suffixes(p + 2, 0, errorCode);
884 while(suffixes.next(errorCode)) {
886 ce32 = copyFromBaseCE32(c, (uint32_t)suffixes.getValue(), TRUE, errorCode);
887 cond->next = index = addConditionalCE32(context, ce32, errorCode);
888 if(U_FAILURE(errorCode)) { return 0; }
903 errorCode(initialErrorCode) {}
907 utrie2_setRange32(dest.trie, start, end, ce32, TRUE, &errorCode);
911 return U_SUCCESS(errorCode);
918 ce32 = dest.encodeOneCE(ce, errorCode);
948 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
951 reinterpret_cast<const int32_t *>(srcCE32s), length, errorCode);
978 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
980 ce32 = dest.encodeExpansion(srcCEs, length, errorCode);
987 cond->context, copyCE32(cond->ce32), errorCode);
993 cond->context, copyCE32(cond->ce32), errorCode);
1014 UErrorCode errorCode;
1030 UErrorCode &errorCode) {
1031 if(U_FAILURE(errorCode)) { return; }
1033 errorCode = U_INVALID_STATE_ERROR;
1036 CopyHelper helper(src, *this, modifier, errorCode);
1038 errorCode = helper.errorCode;
1046 CollationDataBuilder::optimize(const UnicodeSet &set, UErrorCode &errorCode) {
1047 if(U_FAILURE(errorCode) || set.isEmpty()) { return; }
1054 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
1055 utrie2_set32(trie, c, ce32, &errorCode);
1062 CollationDataBuilder::suppressContractions(const UnicodeSet &set, UErrorCode &errorCode) {
1063 if(U_FAILURE(errorCode) || set.isEmpty()) { return; }
1071 ce32 = copyFromBaseCE32(c, ce32, FALSE /* without context */, errorCode);
1072 utrie2_set32(trie, c, ce32, &errorCode);
1079 utrie2_set32(trie, c, ce32, &errorCode);
1087 CollationDataBuilder::getJamoCE32s(uint32_t jamoCE32s[], UErrorCode &errorCode) {
1088 if(U_FAILURE(errorCode)) { return FALSE; }
1135 errorCode = U_INTERNAL_PROGRAM_ERROR;
1146 /*withContext=*/ TRUE, errorCode);
1150 return anyJamoAssigned && U_SUCCESS(errorCode);
1154 CollationDataBuilder::setDigitTags(UErrorCode &errorCode) {
1155 UnicodeSet digits(UNICODE_STRING_SIMPLE("[:Nd:]"), errorCode);
1156 if(U_FAILURE(errorCode)) { return; }
1163 int32_t index = addCE32(ce32, errorCode);
1164 if(U_FAILURE(errorCode)) { return; }
1166 errorCode = U_BUFFER_OVERFLOW_ERROR;
1171 utrie2_set32(trie, c, ce32, &errorCode);
1201 CollationDataBuilder::setLeadSurrogates(UErrorCode &errorCode) {
1208 &errorCode);
1213 CollationDataBuilder::build(CollationData &data, UErrorCode &errorCode) {
1214 buildMappings(data, errorCode);
1223 buildFastLatinTable(data, errorCode);
1227 CollationDataBuilder::buildMappings(CollationData &data, UErrorCode &errorCode) {
1228 if(U_FAILURE(errorCode)) { return; }
1230 errorCode = U_INVALID_STATE_ERROR;
1234 buildContexts(errorCode);
1238 if(getJamoCE32s(jamoCE32s, errorCode)) {
1241 ce32s.addElement((int32_t)jamoCE32s[i], errorCode);
1265 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1275 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1280 setDigitTags(errorCode);
1281 setLeadSurrogates(errorCode);
1285 utrie2_set32(trie, 0, Collation::makeCE32FromTagAndIndex(Collation::U0000_TAG, 0), &errorCode);
1287 utrie2_freeze(trie, UTRIE2_32_VALUE_BITS, &errorCode);
1288 if(U_FAILURE(errorCode)) { return; }
1331 CollationDataBuilder::buildContexts(UErrorCode &errorCode) {
1332 if(U_FAILURE(errorCode)) { return; }
1337 while(U_SUCCESS(errorCode) && iter.next()) {
1343 errorCode = U_INTERNAL_PROGRAM_ERROR;
1347 ce32 = buildContext(cond, errorCode);
1348 utrie2_set32(trie, c, ce32, &errorCode);
1353 CollationDataBuilder::buildContext(ConditionalCE32 *head, UErrorCode &errorCode) {
1354 if(U_FAILURE(errorCode)) { return 0; }
1359 UCharsTrieBuilder prefixBuilder(errorCode);
1360 UCharsTrieBuilder contractionBuilder(errorCode);
1427 contractionBuilder.add(suffix, (int32_t)cond->ce32, errorCode);
1431 int32_t index = addContextTrie(emptySuffixCE32, contractionBuilder, errorCode);
1432 if(U_FAILURE(errorCode)) { return 0; }
1434 errorCode = U_BUFFER_OVERFLOW_ERROR;
1449 prefixBuilder.add(prefix, (int32_t)ce32, errorCode);
1454 int32_t index = addContextTrie(head->defaultCE32, prefixBuilder, errorCode);
1455 if(U_FAILURE(errorCode)) { return 0; }
1457 errorCode = U_BUFFER_OVERFLOW_ERROR;
1465 UErrorCode &errorCode) {
1469 context.append(trieBuilder.buildUnicodeString(USTRINGTRIE_BUILD_SMALL, trieString, errorCode));
1470 if(U_FAILURE(errorCode)) { return -1; }
1480 CollationDataBuilder::buildFastLatinTable(CollationData &data, UErrorCode &errorCode) {
1481 if(U_FAILURE(errorCode) || !fastLatinEnabled) { return; }
1484 fastLatinBuilder = new CollationFastLatinBuilder(errorCode);
1486 errorCode = U_MEMORY_ALLOCATION_ERROR;
1489 if(fastLatinBuilder->forData(data, errorCode)) {