Lines Matching refs:errorCode

80 CollationLoader::loadRootRules(UErrorCode &errorCode) {
81 if(U_FAILURE(errorCode)) { return; }
82 rootBundle = ures_open(U_ICUDATA_COLL, kRootLocaleName, &errorCode);
83 if(U_FAILURE(errorCode)) { return; }
84 rootRules = ures_getStringByKey(rootBundle, "UCARules", &rootRulesLength, &errorCode);
85 if(U_FAILURE(errorCode)) {
95 UErrorCode errorCode = U_ZERO_ERROR;
96 umtx_initOnce(gInitOnce, CollationLoader::loadRootRules, errorCode);
97 if(U_SUCCESS(errorCode)) {
104 UnicodeString &rules, UErrorCode &errorCode) {
105 if(U_FAILURE(errorCode)) { return; }
111 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
117 LocalUResourceBundlePointer bundle(ures_open(U_ICUDATA_COLL, localeID, &errorCode));
119 ures_getByKey(bundle.getAlias(), "collations", NULL, &errorCode));
121 ures_getByKeyWithFallback(collations.getAlias(), type, NULL, &errorCode));
123 const UChar *s = ures_getStringByKey(data.getAlias(), "Sequence", &length, &errorCode);
124 if(U_FAILURE(errorCode)) { return; }
129 errorCode = U_MEMORY_ALLOCATION_ERROR;
136 UErrorCode &errorCode) const {
140 return loader->createCacheEntry(errorCode);
144 CollationLoader::loadTailoring(const Locale &locale, UErrorCode &errorCode) {
145 const CollationCacheEntry *rootEntry = CollationRoot::getRootCacheEntry(errorCode);
146 if(U_FAILURE(errorCode)) { return NULL; }
156 errorCode = U_ZERO_ERROR;
157 CollationLoader loader(rootEntry, locale, errorCode);
160 return loader.getCacheEntry(errorCode);
164 UErrorCode &errorCode)
165 : cache(UnifiedCache::getInstance(errorCode)), rootEntry(re),
171 if(U_FAILURE(errorCode)) { return; }
180 type, UPRV_LENGTHOF(type) - 1, errorCode);
181 if(U_FAILURE(errorCode)) {
182 errorCode = U_ILLEGAL_ARGUMENT_ERROR;
194 locale.setKeywordValue("collation", type, errorCode);
206 CollationLoader::createCacheEntry(UErrorCode &errorCode) {
213 return loadFromLocale(errorCode);
215 return loadFromBundle(errorCode);
217 return loadFromCollations(errorCode);
219 return loadFromData(errorCode);
224 CollationLoader::loadFromLocale(UErrorCode &errorCode) {
225 if(U_FAILURE(errorCode)) { return NULL; }
227 bundle = ures_openNoDefault(U_ICUDATA_COLL, locale.getBaseName(), &errorCode);
228 if(errorCode == U_MISSING_RESOURCE_ERROR) {
229 errorCode = U_USING_DEFAULT_WARNING;
236 const char *vLocale = ures_getLocaleByType(bundle, ULOC_ACTUAL_LOCALE, &errorCode);
237 if(U_FAILURE(errorCode)) { return NULL; }
240 locale.setKeywordValue("collation", type, errorCode);
243 return getCacheEntry(errorCode);
245 return loadFromBundle(errorCode);
250 CollationLoader::loadFromBundle(UErrorCode &errorCode) {
251 if(U_FAILURE(errorCode)) { return NULL; }
254 collations = ures_getByKey(bundle, "collations", NULL, &errorCode);
255 if(errorCode == U_MISSING_RESOURCE_ERROR) {
256 errorCode = U_USING_DEFAULT_WARNING;
258 return makeCacheEntryFromRoot(validLocale, errorCode);
260 if(U_FAILURE(errorCode)) { return NULL; }
294 locale.setKeywordValue("collation", type, errorCode);
295 return getCacheEntry(errorCode);
306 return loadFromCollations(errorCode);
311 CollationLoader::loadFromCollations(UErrorCode &errorCode) {
312 if(U_FAILURE(errorCode)) { return NULL; }
316 ures_getByKeyWithFallback(collations, type, NULL, &errorCode));
318 if(errorCode == U_MISSING_RESOURCE_ERROR) {
319 errorCode = U_USING_DEFAULT_WARNING;
336 return makeCacheEntryFromRoot(validLocale, errorCode);
338 locale.setKeywordValue("collation", type, errorCode);
339 return getCacheEntry(errorCode);
341 if(U_FAILURE(errorCode)) { return NULL; }
344 const char *actualLocale = ures_getLocaleByType(data, ULOC_ACTUAL_LOCALE, &errorCode);
345 if(U_FAILURE(errorCode)) { return NULL; }
353 validLocale.setKeywordValue("collation", type, errorCode);
354 if(U_FAILURE(errorCode)) { return NULL; }
361 errorCode = U_USING_DEFAULT_WARNING;
363 return makeCacheEntryFromRoot(validLocale, errorCode);
368 locale.setKeywordValue("collation", type, errorCode);
369 const CollationCacheEntry *entry = getCacheEntry(errorCode);
370 return makeCacheEntry(validLocale, entry, errorCode);
372 return loadFromData(errorCode);
377 CollationLoader::loadFromData(UErrorCode &errorCode) {
378 if(U_FAILURE(errorCode)) { return NULL; }
381 errorCode = U_MEMORY_ALLOCATION_ERROR;
386 LocalUResourceBundlePointer binary(ures_getByKey(data, "%%CollationBin", NULL, &errorCode));
390 const uint8_t *inBytes = ures_getBinary(binary.getAlias(), &length, &errorCode);
391 CollationDataReader::read(rootEntry->tailoring, inBytes, length, *t, errorCode);
394 if(U_FAILURE(errorCode)) { return NULL; }
419 ures_open(U_ICUDATA_COLL, actualLocale, &errorCode));
420 if(U_FAILURE(errorCode)) { return NULL; }
435 t->actualLocale.setKeywordValue("collation", type, errorCode);
438 t->actualLocale.setKeywordValue("collation", NULL, errorCode);
440 if(U_FAILURE(errorCode)) { return NULL; }
443 errorCode = U_USING_DEFAULT_WARNING;
449 errorCode = U_MEMORY_ALLOCATION_ERROR;
459 CollationLoader::getCacheEntry(UErrorCode &errorCode) {
462 cache->get(key, this, entry, errorCode);
469 UErrorCode &errorCode) const {
470 if (U_FAILURE(errorCode)) {
474 return makeCacheEntry(validLocale, rootEntry, errorCode);
481 UErrorCode &errorCode) {
482 if(U_FAILURE(errorCode) || loc == entryFromCache->validLocale) {
487 errorCode = U_MEMORY_ALLOCATION_ERROR;