Home | History | Annotate | Download | only in i18n

Lines Matching defs:errorCode

61             const char *&errorReason, UErrorCode &errorCode);
74 const char *& /*errorReason*/, UErrorCode &errorCode) {
76 return rules = CollationLoader::loadRules(localeID, collationType, errorCode);
98 RuleBasedCollator::RuleBasedCollator(const UnicodeString &rules, UErrorCode &errorCode)
105 internalBuildTailoring(rules, UCOL_DEFAULT, UCOL_DEFAULT, NULL, NULL, errorCode);
109 UErrorCode &errorCode)
116 internalBuildTailoring(rules, strength, UCOL_DEFAULT, NULL, NULL, errorCode);
121 UErrorCode &errorCode)
128 internalBuildTailoring(rules, UCOL_DEFAULT, decompositionMode, NULL, NULL, errorCode);
134 UErrorCode &errorCode)
141 internalBuildTailoring(rules, strength, decompositionMode, NULL, NULL, errorCode);
146 UErrorCode &errorCode)
153 internalBuildTailoring(rules, UCOL_DEFAULT, UCOL_DEFAULT, &parseError, &reason, errorCode);
161 UErrorCode &errorCode) {
162 const CollationTailoring *base = CollationRoot::getRoot(errorCode);
163 if(U_FAILURE(errorCode)) { return; }
165 CollationBuilder builder(base, errorCode);
170 outParseError, errorCode));
171 if(U_FAILURE(errorCode)) {
183 setAttribute(UCOL_STRENGTH, (UColAttributeValue)strength, errorCode);
186 setAttribute(UCOL_NORMALIZATION_MODE, decompositionMode, errorCode);
192 CollationBuilder::CollationBuilder(const CollationTailoring *b, UErrorCode &errorCode)
193 : nfd(*Normalizer2::getNFDInstance(errorCode)),
194 fcd(*Normalizer2Factory::getFCDInstance(errorCode)),
195 nfcImpl(*Normalizer2Factory::getNFCImpl(errorCode)),
200 dataBuilder(new CollationDataBuilder(errorCode)), fastLatinEnabled(TRUE),
203 rootPrimaryIndexes(errorCode), nodes(errorCode) {
204 nfcImpl.ensureCanonIterData(errorCode);
205 if(U_FAILURE(errorCode)) {
210 errorCode = U_MEMORY_ALLOCATION_ERROR;
213 dataBuilder->initForTailoring(baseData, errorCode);
214 if(U_FAILURE(errorCode)) {
228 UErrorCode &errorCode) {
229 if(U_FAILURE(errorCode)) { return NULL; }
231 errorCode = U_MISSING_RESOURCE_ERROR;
237 errorCode = U_MEMORY_ALLOCATION_ERROR;
240 CollationRuleParser parser(baseData, errorCode);
241 if(U_FAILURE(errorCode)) { return NULL; }
251 parser.parse(ruleString, ownedSettings, outParseError, errorCode);
253 if(U_FAILURE(errorCode)) { return NULL; }
255 makeTailoredCEs(errorCode);
256 closeOverComposites(errorCode);
257 finalizeCEs(errorCode);
264 dataBuilder->optimize(optimizeSet, errorCode);
265 tailoring->ensureOwnedData(errorCode);
266 if(U_FAILURE(errorCode)) { return NULL; }
268 dataBuilder->build(*tailoring->ownedData, errorCode);
274 if(U_FAILURE(errorCode)) { return NULL; }
286 const char *&parserErrorReason, UErrorCode &errorCode) {
287 if(U_FAILURE(errorCode)) { return; }
290 ces[0] = getSpecialResetPosition(str, parserErrorReason, errorCode);
292 if(U_FAILURE(errorCode)) { return; }
296 UnicodeString nfdString = nfd.normalize(str, errorCode);
297 if(U_FAILURE(errorCode)) {
303 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
312 int32_t index = findOrInsertNodeForCEs(strength, parserErrorReason, errorCode);
313 if(U_FAILURE(errorCode)) { return; }
331 errorCode = U_UNSUPPORTED_ERROR;
337 errorCode = U_UNSUPPORTED_ERROR;
343 errorCode = U_UNSUPPORTED_ERROR;
348 index = findOrInsertNodeForPrimary(p, errorCode);
368 errorCode = U_UNSUPPORTED_ERROR;
435 index = insertNodeBetween(previousIndex, index, node, errorCode);
455 index = insertNodeBetween(index, nextIndex, node, errorCode);
458 insertNodeBetween(index, nextIndex, node, errorCode);
464 if(U_FAILURE(errorCode)) {
473 const char *&parserErrorReason, UErrorCode &errorCode) {
489 int32_t index = findOrInsertNodeForRootCE(0, UCOL_TERTIARY, errorCode);
490 if(U_FAILURE(errorCode)) { return 0; }
508 int32_t index = findOrInsertNodeForRootCE(0, UCOL_SECONDARY, errorCode);
509 if(U_FAILURE(errorCode)) { return 0; }
561 errorCode = U_UNSUPPORTED_ERROR;
569 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
577 int32_t index = findOrInsertNodeForRootCE(ce, strength, errorCode);
578 if(U_FAILURE(errorCode)) { return 0; }
601 index = findOrInsertNodeForRootCE(ce, UCOL_PRIMARY, errorCode);
602 if(U_FAILURE(errorCode)) { return 0; }
643 const char *&parserErrorReason, UErrorCode &errorCode) {
644 if(U_FAILURE(errorCode)) { return; }
647 nfd.normalize(prefix, nfdPrefix, errorCode);
648 if(U_FAILURE(errorCode)) {
653 UnicodeString nfdString = nfd.normalize(str, errorCode);
654 if(U_FAILURE(errorCode)) {
668 errorCode = U_UNSUPPORTED_ERROR;
678 errorCode = U_UNSUPPORTED_ERROR;
692 int32_t index = findOrInsertNodeForCEs(strength, parserErrorReason, errorCode);
697 errorCode = U_UNSUPPORTED_ERROR;
704 errorCode = U_UNSUPPORTED_ERROR;
709 index = insertTailoredNodeAfter(index, strength, errorCode);
710 if(U_FAILURE(errorCode)) {
721 setCaseBits(nfdString, parserErrorReason, errorCode);
722 if(U_FAILURE(errorCode)) { return; }
726 UnicodeString nfdExtension = nfd.normalize(extension, errorCode);
727 if(U_FAILURE(errorCode)) {
733 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
741 !ignorePrefix(prefix, errorCode) && !ignoreString(str, errorCode)) {
745 ce32 = addIfDifferent(prefix, str, ces, cesLength, ce32, errorCode);
747 addWithClosure(nfdPrefix, nfdString, ces, cesLength, ce32, errorCode);
748 if(U_FAILURE(errorCode)) {
757 UErrorCode &errorCode) {
758 if(U_FAILURE(errorCode)) { return 0; }
783 errorCode = U_UNSUPPORTED_ERROR;
787 return findOrInsertNodeForRootCE(ce, strength, errorCode);
791 CollationBuilder::findOrInsertNodeForRootCE(int64_t ce, int32_t strength, UErrorCode &errorCode) {
792 if(U_FAILURE(errorCode)) { return 0; }
799 int32_t index = findOrInsertNodeForPrimary((uint32_t)(ce >> 32) , errorCode);
802 index = findOrInsertWeakNode(index, lower32 >> 16, UCOL_SECONDARY, errorCode);
805 UCOL_TERTIARY, errorCode);
849 CollationBuilder::findOrInsertNodeForPrimary(uint32_t p, UErrorCode &errorCode) {
850 if(U_FAILURE(errorCode)) { return 0; }
859 nodes.addElement(nodeFromWeight32(p), errorCode);
860 rootPrimaryIndexes.insertElementAt(index, ~rootIndex, errorCode);
866 CollationBuilder::findOrInsertWeakNode(int32_t index, uint32_t weight16, int32_t level, UErrorCode &errorCode) {
867 if(U_FAILURE(errorCode)) { return 0; }
902 return insertNodeBetween(index, nextIndex, node, errorCode);
906 CollationBuilder::insertTailoredNodeAfter(int32_t index, int32_t strength, UErrorCode &errorCode) {
907 if(U_FAILURE(errorCode)) { return 0; }
926 return insertNodeBetween(index, nextIndex, node, errorCode);
931 UErrorCode &errorCode) {
932 if(U_FAILURE(errorCode)) { return 0; }
939 nodes.addElement(node, errorCode);
940 if(U_FAILURE(errorCode)) { return 0; }
980 const char *&parserErrorReason, UErrorCode &errorCode) {
981 if(U_FAILURE(errorCode)) { return; }
995 int32_t baseCEsLength = baseCEs.fetchCEs(errorCode) - 1;
996 if(U_FAILURE(errorCode)) {
1050 UErrorCode &errorCode) {
1051 if(U_FAILURE(errorCode)) { return; }
1052 dataBuilder->suppressContractions(set, errorCode);
1053 if(U_FAILURE(errorCode)) {
1060 UErrorCode &errorCode) {
1061 if(U_FAILURE(errorCode)) { return; }
1068 UErrorCode &errorCode) {
1070 ce32 = addIfDifferent(nfdPrefix, nfdString, newCEs, newCEsLength, ce32, errorCode);
1071 ce32 = addOnlyClosure(nfdPrefix, nfdString, newCEs, newCEsLength, ce32, errorCode);
1072 addTailComposites(nfdPrefix, nfdString, errorCode);
1079 UErrorCode &errorCode) {
1080 if(U_FAILURE(errorCode)) { return ce32; }
1084 CanonicalIterator stringIter(nfdString, errorCode);
1085 if(U_FAILURE(errorCode)) { return ce32; }
1090 if(ignoreString(str, errorCode) || str == nfdString) { continue; }
1091 ce32 = addIfDifferent(prefix, str, newCEs, newCEsLength, ce32, errorCode);
1092 if(U_FAILURE(errorCode)) { return ce32; }
1095 CanonicalIterator prefixIter(nfdPrefix, errorCode);
1096 CanonicalIterator stringIter(nfdString, errorCode);
1097 if(U_FAILURE(errorCode)) { return ce32; }
1101 if(ignorePrefix(prefix, errorCode)) { continue; }
1106 if(ignoreString(str, errorCode) || (samePrefix && str == nfdString)) { continue; }
1107 ce32 = addIfDifferent(prefix, str, newCEs, newCEsLength, ce32, errorCode);
1108 if(U_FAILURE(errorCode)) { return ce32; }
1118 UErrorCode &errorCode) {
1119 if(U_FAILURE(errorCode)) { return; }
1148 newNFDString, newString, errorCode)) {
1172 newCEs, newCEsLength, Collation::UNASSIGNED_CE32, errorCode);
1175 addOnlyClosure(nfdPrefix, newNFDString, newCEs, newCEsLength, ce32, errorCode);
1185 UErrorCode &errorCode) const {
1186 if(U_FAILURE(errorCode)) { return FALSE; }
1262 U_ASSERT(nfd.isNormalized(newNFDString, errorCode));
1263 U_ASSERT(fcd.isNormalized(newString, errorCode));
1264 U_ASSERT(nfd.normalize(newString, errorCode) == newNFDString); // canonically equivalent
1269 CollationBuilder::ignorePrefix(const UnicodeString &s, UErrorCode &errorCode) const {
1271 return !isFCD(s, errorCode);
1275 CollationBuilder::ignoreString(const UnicodeString &s, UErrorCode &errorCode) const {
1278 return !isFCD(s, errorCode) || Hangul::isHangul(s.charAt(0));
1282 CollationBuilder::isFCD(const UnicodeString &s, UErrorCode &errorCode) const {
1283 return U_SUCCESS(errorCode) && fcd.isNormalized(s, errorCode);
1287 CollationBuilder::closeOverComposites(UErrorCode &errorCode) {
1288 UnicodeSet composites(UNICODE_STRING_SIMPLE("[:NFD_QC=N:]"), errorCode); // Java: static final
1289 if(U_FAILURE(errorCode)) { return; }
1306 addIfDifferent(prefix, composite, ces, cesLength, Collation::UNASSIGNED_CE32, errorCode);
1313 UErrorCode &errorCode) {
1314 if(U_FAILURE(errorCode)) { return ce32; }
1319 ce32 = dataBuilder->encodeCEs(newCEs, newCEsLength, errorCode);
1321 dataBuilder->addCE32(prefix, str, ce32, errorCode);
1352 CollationBuilder::makeTailoredCEs(UErrorCode &errorCode) {
1353 if(U_FAILURE(errorCode)) { return; }
1384 errorCode = U_BUFFER_OVERFLOW_ERROR;
1417 errorCode = U_BUFFER_OVERFLOW_ERROR;
1464 errorCode = U_BUFFER_OVERFLOW_ERROR;
1493 errorCode = U_BUFFER_OVERFLOW_ERROR; // TODO: introduce a more specific UErrorCode?
1567 CollationBuilder::finalizeCEs(UErrorCode &errorCode) {
1568 if(U_FAILURE(errorCode)) { return; }
1569 LocalPointer<CollationDataBuilder> newBuilder(new CollationDataBuilder(errorCode));
1571 errorCode = U_MEMORY_ALLOCATION_ERROR;
1574 newBuilder->initForTailoring(baseData, errorCode);
1576 newBuilder->copyFrom(*dataBuilder, finalizer, errorCode);
1577 if(U_FAILURE(errorCode)) { return; }