Logo Search packages:      
Sourcecode: icu version File versions  Download package

URegistryKey U_EXPORT2 NumberFormat::registerFactory ( NumberFormatFactory toAdopt,
UErrorCode status 
) [static, inherited]

Register a new NumberFormatFactory. The factory will be adopted.

Parameters:
toAdopt the NumberFormatFactory instance to be adopted
status the in/out status code, no special meanings are assigned
Returns:
a registry key that can be used to unregister this factory ICU 2.6

Definition at line 838 of file numfmt.cpp.

References NULL, and U_MEMORY_ALLOCATION_ERROR.

{
  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;
}


Generated by  Doxygen 1.6.0   Back to index