Home | History | Annotate | Download | only in i18n

Lines Matching refs:errorCode

82 CollationLoader::loadRootRules(UErrorCode &errorCode) {
83 if(U_FAILURE(errorCode)) { return; }
84 rootBundle = ures_open(U_ICUDATA_COLL, kRootLocaleName, &errorCode);
85 if(U_FAILURE(errorCode)) { return; }
86 rootRules = ures_getStringByKey(rootBundle, "UCARules", &rootRulesLength, &errorCode);
87 if(U_FAILURE(errorCode)) {
99 UErrorCode errorCode = U_ZERO_ERROR;
100 umtx_initOnce(gInitOnce, CollationLoader::loadRootRules, errorCode);
101 if(U_SUCCESS(errorCode)) {
108 UnicodeString &rules, UErrorCode &errorCode) {
109 if(U_FAILURE(errorCode)) { return; }
115 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
121 LocalUResourceBundlePointer bundle(ures_open(U_ICUDATA_COLL, localeID, &errorCode));
123 ures_getByKey(bundle.getAlias(), "collations", NULL, &errorCode));
125 ures_getByKeyWithFallback(collations.getAlias(), type, NULL, &errorCode));
127 const UChar *s = ures_getStringByKey(data.getAlias(), "Sequence", &length, &errorCode);
128 if(U_FAILURE(errorCode)) { return; }
133 errorCode = U_MEMORY_ALLOCATION_ERROR;
140 UErrorCode &errorCode) const {
144 return loader->createCacheEntry(errorCode);
148 CollationLoader::loadTailoring(const Locale &locale, UErrorCode &errorCode) {
149 const CollationCacheEntry *rootEntry = CollationRoot::getRootCacheEntry(errorCode);
150 if(U_FAILURE(errorCode)) { return NULL; }
160 errorCode = U_ZERO_ERROR;
161 CollationLoader loader(rootEntry, locale, errorCode);
164 return loader.getCacheEntry(errorCode);
168 UErrorCode &errorCode)
169 : cache(UnifiedCache::getInstance(errorCode)), rootEntry(re),
175 if(U_FAILURE(errorCode)) { return; }
184 type, UPRV_LENGTHOF(type) - 1, errorCode);
185 if(U_FAILURE(errorCode)) {
186 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
198 locale.setKeywordValue("collation", type, errorCode);
210 CollationLoader::createCacheEntry(UErrorCode &errorCode) {
217 return loadFromLocale(errorCode);
219 return loadFromBundle(errorCode);
221 return loadFromCollations(errorCode);
223 return loadFromData(errorCode);
228 CollationLoader::loadFromLocale(UErrorCode &errorCode) {
229 if(U_FAILURE(errorCode)) { return NULL; }
231 bundle = ures_openNoDefault(U_ICUDATA_COLL, locale.getBaseName(), &errorCode);
232 if(errorCode == U_MISSING_RESOURCE_ERROR) {
233 errorCode = U_USING_DEFAULT_WARNING;
240 const char *vLocale = ures_getLocaleByType(bundle, ULOC_ACTUAL_LOCALE, &errorCode);
241 if(U_FAILURE(errorCode)) { return NULL; }
244 locale.setKeywordValue("collation", type, errorCode);
247 return getCacheEntry(errorCode);
249 return loadFromBundle(errorCode);
254 CollationLoader::loadFromBundle(UErrorCode &errorCode) {
255 if(U_FAILURE(errorCode)) { return NULL; }
258 collations = ures_getByKey(bundle, "collations", NULL, &errorCode);
259 if(errorCode == U_MISSING_RESOURCE_ERROR) {
260 errorCode = U_USING_DEFAULT_WARNING;
262 return makeCacheEntryFromRoot(validLocale, errorCode);
264 if(U_FAILURE(errorCode)) { return NULL; }
298 locale.setKeywordValue("collation", type, errorCode);
299 return getCacheEntry(errorCode);
310 return loadFromCollations(errorCode);
315 CollationLoader::loadFromCollations(UErrorCode &errorCode) {
316 if(U_FAILURE(errorCode)) { return NULL; }
320 ures_getByKeyWithFallback(collations, type, NULL, &errorCode));
322 if(errorCode == U_MISSING_RESOURCE_ERROR) {
323 errorCode = U_USING_DEFAULT_WARNING;
340 return makeCacheEntryFromRoot(validLocale, errorCode);
342 locale.setKeywordValue("collation", type, errorCode);
343 return getCacheEntry(errorCode);
345 if(U_FAILURE(errorCode)) { return NULL; }
348 const char *actualLocale = ures_getLocaleByType(data, ULOC_ACTUAL_LOCALE, &errorCode);
349 if(U_FAILURE(errorCode)) { return NULL; }
357 validLocale.setKeywordValue("collation", type, errorCode);
358 if(U_FAILURE(errorCode)) { return NULL; }
365 errorCode = U_USING_DEFAULT_WARNING;
367 return makeCacheEntryFromRoot(validLocale, errorCode);
372 locale.setKeywordValue("collation", type, errorCode);
373 const CollationCacheEntry *entry = getCacheEntry(errorCode);
374 return makeCacheEntry(validLocale, entry, errorCode);
376 return loadFromData(errorCode);
381 CollationLoader::loadFromData(UErrorCode &errorCode) {
382 if(U_FAILURE(errorCode)) { return NULL; }
385 errorCode = U_MEMORY_ALLOCATION_ERROR;
390 LocalUResourceBundlePointer binary(ures_getByKey(data, "%%CollationBin", NULL, &errorCode));
394 const uint8_t *inBytes = ures_getBinary(binary.getAlias(), &length, &errorCode);
395 CollationDataReader::read(rootEntry->tailoring, inBytes, length, *t, errorCode);
398 if(U_FAILURE(errorCode)) { return NULL; }
423 ures_open(U_ICUDATA_COLL, actualLocale, &errorCode));
424 if(U_FAILURE(errorCode)) { return NULL; }
439 t->actualLocale.setKeywordValue("collation", type, errorCode);
442 t->actualLocale.setKeywordValue("collation", NULL, errorCode);
444 if(U_FAILURE(errorCode)) { return NULL; }
447 errorCode = U_USING_DEFAULT_WARNING;
453 errorCode = U_MEMORY_ALLOCATION_ERROR;
463 CollationLoader::getCacheEntry(UErrorCode &errorCode) {
466 cache->get(key, this, entry, errorCode);
473 UErrorCode &errorCode) const {
474 if (U_FAILURE(errorCode)) {
478 return makeCacheEntry(validLocale, rootEntry, errorCode);
485 UErrorCode &errorCode) {
486 if(U_FAILURE(errorCode) || loc == entryFromCache->validLocale) {
491 errorCode = U_MEMORY_ALLOCATION_ERROR;
620 KeywordsSink(UErrorCode &errorCode) :
621 values(ulist_createEmptyList(&errorCode)), hasDefault(FALSE) {}
625 UErrorCode &errorCode) {
626 if (U_FAILURE(errorCode)) { return; }
627 ResourceTable collations = value.getTable(errorCode);
633 defcoll.appendInvariantChars(value.getUnicodeString(errorCode), errorCode);
634 if (U_SUCCESS(errorCode) && !defcoll.isEmpty()) {
637 errorCode = U_MEMORY_ALLOCATION_ERROR;
641 ulist_addItemBeginList(values, ownedDefault, TRUE, &errorCode);
647 ulist_addItemEndList(values, key, FALSE, &errorCode);
650 if (U_FAILURE(errorCode)) { return; }