Lines Matching refs:errorCode
135 virtual UChar32 nextCodePoint(UErrorCode &errorCode);
136 virtual UChar32 previousCodePoint(UErrorCode &errorCode);
139 virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode);
140 virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode);
143 virtual uint32_t getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode);
179 UErrorCode errorCode = U_ZERO_ERROR;
180 while(U_SUCCESS(errorCode) && pos < s->length()) {
193 appendCEsFromCE32(d, c, ce32, /*forward=*/ TRUE, errorCode);
194 U_ASSERT(U_SUCCESS(errorCode));
220 DataBuilderCollationIterator::nextCodePoint(UErrorCode & /*errorCode*/) {
230 DataBuilderCollationIterator::previousCodePoint(UErrorCode & /*errorCode*/) {
240 DataBuilderCollationIterator::forwardNumCodePoints(int32_t num, UErrorCode & /*errorCode*/) {
245 DataBuilderCollationIterator::backwardNumCodePoints(int32_t num, UErrorCode & /*errorCode*/) {
255 DataBuilderCollationIterator::getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode) {
264 cond->builtCE32 = builder.buildContext(cond, errorCode);
265 if(errorCode == U_BUFFER_OVERFLOW_ERROR) {
266 errorCode = U_ZERO_ERROR;
268 cond->builtCE32 = builder.buildContext(cond, errorCode);
278 CollationDataBuilder::CollationDataBuilder(UErrorCode &errorCode)
279 : nfcImpl(*Normalizer2Factory::getNFCImpl(errorCode)),
282 ce32s(errorCode), ce64s(errorCode), conditionalCE32s(errorCode),
287 ce32s.addElement(0, errorCode);
298 CollationDataBuilder::initForTailoring(const CollationData *b, UErrorCode &errorCode) {
299 if(U_FAILURE(errorCode)) { return; }
301 errorCode = U_INVALID_STATE_ERROR;
305 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
311 trie = utrie2_open(Collation::FALLBACK_CE32, Collation::FFFD_CE32, &errorCode);
319 utrie2_set32(trie, c, Collation::FALLBACK_CE32, &errorCode);
327 utrie2_setRange32(trie, Hangul::HANGUL_BASE, Hangul::HANGUL_END, hangulCE32, TRUE, &errorCode);
333 if(U_FAILURE(errorCode)) { return; }
339 UErrorCode &errorCode) {
340 if(U_FAILURE(errorCode)) { return FALSE; }
358 int32_t index = addCE(dataCE, errorCode);
359 if(U_FAILURE(errorCode)) { return 0; }
361 errorCode = U_BUFFER_OVERFLOW_ERROR;
365 utrie2_setRange32(trie, start, end, offsetCE32, TRUE, &errorCode);
376 UErrorCode &errorCode) {
377 if(U_FAILURE(errorCode)) { return 0; }
379 if(maybeSetPrimaryRange(start, end, primary, step, errorCode)) {
385 utrie2_set32(trie, start, Collation::makeLongPrimaryCE32(primary), &errorCode);
423 CollationDataBuilder::getSingleCE(UChar32 c, UErrorCode &errorCode) const {
424 if(U_FAILURE(errorCode)) { return 0; }
440 errorCode = U_UNSUPPORTED_ERROR;
444 errorCode = U_INTERNAL_PROGRAM_ERROR;
456 errorCode = U_UNSUPPORTED_ERROR;
464 errorCode = U_UNSUPPORTED_ERROR;
488 CollationDataBuilder::addCE(int64_t ce, UErrorCode &errorCode) {
493 ce64s.addElement(ce, errorCode);
498 CollationDataBuilder::addCE32(uint32_t ce32, UErrorCode &errorCode) {
503 ce32s.addElement((int32_t)ce32, errorCode);
509 UErrorCode &errorCode) {
510 if(U_FAILURE(errorCode)) { return -1; }
514 errorCode = U_BUFFER_OVERFLOW_ERROR;
519 errorCode = U_MEMORY_ALLOCATION_ERROR;
522 conditionalCE32s.addElement(cond, errorCode);
529 UErrorCode &errorCode) {
530 uint32_t ce32 = encodeCEs(ces, cesLength, errorCode);
531 addCE32(prefix, s, ce32, errorCode);
536 uint32_t ce32, UErrorCode &errorCode) {
537 if(U_FAILURE(errorCode)) { return; }
539 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
543 errorCode = U_INVALID_STATE_ERROR;
557 oldCE32 = copyFromBaseCE32(c, baseCE32, TRUE, errorCode);
558 utrie2_set32(trie, c, oldCE32, &errorCode);
559 if(U_FAILURE(errorCode)) { return; }
565 utrie2_set32(trie, c, ce32, &errorCode);
576 int32_t index = addConditionalCE32(UnicodeString((UChar)0), oldCE32, errorCode);
577 if(U_FAILURE(errorCode)) { return; }
579 utrie2_set32(trie, c, contextCE32, &errorCode);
595 int32_t index = addConditionalCE32(context, ce32, errorCode);
596 if(U_FAILURE(errorCode)) { return; }
604 int32_t index = addConditionalCE32(context, ce32, errorCode);
605 if(U_FAILURE(errorCode)) { return; }
640 CollationDataBuilder::encodeOneCE(int64_t ce, UErrorCode &errorCode) {
644 int32_t index = addCE(ce, errorCode);
645 if(U_FAILURE(errorCode)) { return 0; }
647 errorCode = U_BUFFER_OVERFLOW_ERROR;
655 UErrorCode &errorCode) {
656 if(U_FAILURE(errorCode)) { return 0; }
658 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
662 errorCode = U_INVALID_STATE_ERROR;
670 return encodeOneCE(ces[0], errorCode);
692 return encodeExpansion32(newCE32s, cesLength, errorCode);
698 return encodeExpansion(ces, cesLength, errorCode);
702 CollationDataBuilder::encodeExpansion(const int64_t ces[], int32_t length, UErrorCode &errorCode) {
703 if(U_FAILURE(errorCode)) { return 0; }
710 errorCode = U_BUFFER_OVERFLOW_ERROR;
725 errorCode = U_BUFFER_OVERFLOW_ERROR;
729 ce64s.addElement(ces[j], errorCode);
736 UErrorCode &errorCode) {
737 if(U_FAILURE(errorCode)) { return 0; }
744 errorCode = U_BUFFER_OVERFLOW_ERROR;
759 errorCode = U_BUFFER_OVERFLOW_ERROR;
763 ce32s.addElement(newCE32s[j], errorCode);
770 UErrorCode &errorCode) {
771 if(U_FAILURE(errorCode)) { return 0; }
783 reinterpret_cast<const int32_t *>(baseCE32s), length, errorCode);
789 ce32 = encodeExpansion(baseCEs, length, errorCode);
798 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
804 index = copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
806 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
807 head.next = index = addConditionalCE32(context, ce32, errorCode);
809 if(U_FAILURE(errorCode)) { return 0; }
811 UCharsTrie::Iterator prefixes(p + 2, 0, errorCode);
812 while(prefixes.next(errorCode)) {
818 index = copyContractionsFromBaseCE32(context, c, ce32, cond, errorCode);
820 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
821 cond->next = index = addConditionalCE32(context, ce32, errorCode);
823 if(U_FAILURE(errorCode)) { return 0; }
834 return copyFromBaseCE32(c, ce32, FALSE, errorCode);
838 copyContractionsFromBaseCE32(context, c, ce32, &head, errorCode);
844 errorCode = U_UNSUPPORTED_ERROR; // We forbid tailoring of Hangul syllables.
850 ce32 = encodeOneCE(Collation::unassignedCEFromCodePoint(c), errorCode);
861 ConditionalCE32 *cond, UErrorCode &errorCode) {
862 if(U_FAILURE(errorCode)) { return 0; }
874 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
875 cond->next = index = addConditionalCE32(context, ce32, errorCode);
876 if(U_FAILURE(errorCode)) { return 0; }
881 UCharsTrie::Iterator suffixes(p + 2, 0, errorCode);
882 while(suffixes.next(errorCode)) {
884 ce32 = copyFromBaseCE32(c, (uint32_t)suffixes.getValue(), TRUE, errorCode);
885 cond->next = index = addConditionalCE32(context, ce32, errorCode);
886 if(U_FAILURE(errorCode)) { return 0; }
901 errorCode(initialErrorCode) {}
905 utrie2_setRange32(dest.trie, start, end, ce32, TRUE, &errorCode);
909 return U_SUCCESS(errorCode);
916 ce32 = dest.encodeOneCE(ce, errorCode);
946 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
949 reinterpret_cast<const int32_t *>(srcCE32s), length, errorCode);
976 ce32 = dest.encodeCEs(modifiedCEs, length, errorCode);
978 ce32 = dest.encodeExpansion(srcCEs, length, errorCode);
985 cond->context, copyCE32(cond->ce32), errorCode);
991 cond->context, copyCE32(cond->ce32), errorCode);
1012 UErrorCode errorCode;
1028 UErrorCode &errorCode) {
1029 if(U_FAILURE(errorCode)) { return; }
1031 errorCode = U_INVALID_STATE_ERROR;
1034 CopyHelper helper(src, *this, modifier, errorCode);
1036 errorCode = helper.errorCode;
1044 CollationDataBuilder::optimize(const UnicodeSet &set, UErrorCode &errorCode) {
1045 if(U_FAILURE(errorCode) || set.isEmpty()) { return; }
1052 ce32 = copyFromBaseCE32(c, ce32, TRUE, errorCode);
1053 utrie2_set32(trie, c, ce32, &errorCode);
1060 CollationDataBuilder::suppressContractions(const UnicodeSet &set, UErrorCode &errorCode) {
1061 if(U_FAILURE(errorCode) || set.isEmpty()) { return; }
1069 ce32 = copyFromBaseCE32(c, ce32, FALSE /* without context */, errorCode);
1070 utrie2_set32(trie, c, ce32, &errorCode);
1077 utrie2_set32(trie, c, ce32, &errorCode);
1085 CollationDataBuilder::getJamoCE32s(uint32_t jamoCE32s[], UErrorCode &errorCode) {
1086 if(U_FAILURE(errorCode)) { return FALSE; }
1133 errorCode = U_INTERNAL_PROGRAM_ERROR;
1144 /*withContext=*/ TRUE, errorCode);
1148 return anyJamoAssigned && U_SUCCESS(errorCode);
1152 CollationDataBuilder::setDigitTags(UErrorCode &errorCode) {
1153 UnicodeSet digits(UNICODE_STRING_SIMPLE("[:Nd:]"), errorCode);
1154 if(U_FAILURE(errorCode)) { return; }
1161 int32_t index = addCE32(ce32, errorCode);
1162 if(U_FAILURE(errorCode)) { return; }
1164 errorCode = U_BUFFER_OVERFLOW_ERROR;
1169 utrie2_set32(trie, c, ce32, &errorCode);
1199 CollationDataBuilder::setLeadSurrogates(UErrorCode &errorCode) {
1206 &errorCode);
1211 CollationDataBuilder::build(CollationData &data, UErrorCode &errorCode) {
1212 buildMappings(data, errorCode);
1221 buildFastLatinTable(data, errorCode);
1225 CollationDataBuilder::buildMappings(CollationData &data, UErrorCode &errorCode) {
1226 if(U_FAILURE(errorCode)) { return; }
1228 errorCode = U_INVALID_STATE_ERROR;
1232 buildContexts(errorCode);
1236 if(getJamoCE32s(jamoCE32s, errorCode)) {
1239 ce32s.addElement((int32_t)jamoCE32s[i], errorCode);
1263 errorCode);
1273 utrie2_setRange32(trie, c, limit - 1, ce32, TRUE, &errorCode);
1278 setDigitTags(errorCode);
1279 setLeadSurrogates(errorCode);
1283 utrie2_set32(trie, 0, Collation::makeCE32FromTagAndIndex(Collation::U0000_TAG, 0), &errorCode);
1285 utrie2_freeze(trie, UTRIE2_32_VALUE_BITS, &errorCode);
1286 if(U_FAILURE(errorCode)) { return; }
1329 CollationDataBuilder::buildContexts(UErrorCode &errorCode) {
1330 if(U_FAILURE(errorCode)) { return; }
1335 while(U_SUCCESS(errorCode) && iter.next()) {
1341 errorCode = U_INTERNAL_PROGRAM_ERROR;
1345 ce32 = buildContext(cond, errorCode);
1346 utrie2_set32(trie, c, ce32, &errorCode);
1351 CollationDataBuilder::buildContext(ConditionalCE32 *head, UErrorCode &errorCode) {
1352 if(U_FAILURE(errorCode)) { return 0; }
1357 UCharsTrieBuilder prefixBuilder(errorCode);
1358 UCharsTrieBuilder contractionBuilder(errorCode);
1425 contractionBuilder.add(suffix, (int32_t)cond->ce32, errorCode);
1429 int32_t index = addContextTrie(emptySuffixCE32, contractionBuilder, errorCode);
1430 if(U_FAILURE(errorCode)) { return 0; }
1432 errorCode = U_BUFFER_OVERFLOW_ERROR;
1447 prefixBuilder.add(prefix, (int32_t)ce32, errorCode);
1452 int32_t index = addContextTrie(head->defaultCE32, prefixBuilder, errorCode);
1453 if(U_FAILURE(errorCode)) { return 0; }
1455 errorCode = U_BUFFER_OVERFLOW_ERROR;
1463 UErrorCode &errorCode) {
1467 context.append(trieBuilder.buildUnicodeString(USTRINGTRIE_BUILD_SMALL, trieString, errorCode));
1468 if(U_FAILURE(errorCode)) { return -1; }
1478 CollationDataBuilder::buildFastLatinTable(CollationData &data, UErrorCode &errorCode) {
1479 if(U_FAILURE(errorCode) || !fastLatinEnabled) { return; }
1482 fastLatinBuilder = new CollationFastLatinBuilder(errorCode);
1484 errorCode = U_MEMORY_ALLOCATION_ERROR;
1487 if(fastLatinBuilder->forData(data, errorCode)) {