// ------------------------------------- StringEnumeration* U_EXPORT2 NumberFormat::getAvailableLocales(void) { ICULocaleService *service = getNumberFormatService(); if (service) { return service->getAvailableLocales(); } return NULL; // no way to return error condition }
URegistryKey U_EXPORT2 NumberFormat::registerFactory(NumberFormatFactory* toAdopt, UErrorCode& status) { ICULocaleService *service = getNumberFormatService(); if (service) { NFFactory *tempnnf = new NFFactory(toAdopt); if (tempnnf != NULL) { return service->registerFactory(tempnnf, status); } } status = U_MEMORY_ALLOCATION_ERROR; return NULL; }
static UBool haveService() { return !gServiceInitOnce.isReset() && (getNumberFormatService() != NULL); }