1 /* 2 ******************************************************************************* 3 * 4 * Copyright (C) 1998-2011, International Business Machines 5 * Corporation and others. All Rights Reserved. 6 * 7 ******************************************************************************* 8 * 9 * File locbund.h 10 * 11 * Modification History: 12 * 13 * Date Name Description 14 * 10/16/98 stephen Creation. 15 * 02/25/99 stephen Modified for new C API. 16 ******************************************************************************* 17 */ 18 19 #ifndef LOCBUND_H 20 #define LOCBUND_H 21 22 #include "unicode/utypes.h" 23 24 #if !UCONFIG_NO_FORMATTING 25 26 #include "unicode/unum.h" 27 28 #define ULOCALEBUNDLE_NUMBERFORMAT_COUNT ((int32_t)UNUM_SPELLOUT) 29 30 typedef struct ULocaleBundle { 31 char *fLocale; 32 33 UNumberFormat *fNumberFormat[ULOCALEBUNDLE_NUMBERFORMAT_COUNT]; 34 UBool isInvariantLocale; 35 } ULocaleBundle; 36 37 38 /** 39 * Initialize a ULocaleBundle, initializing all formatters to 0. 40 * @param result A ULocaleBundle to initialize. 41 * @param loc The locale of the ULocaleBundle. 42 * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid. 43 */ 44 U_CAPI ULocaleBundle * 45 u_locbund_init(ULocaleBundle *result, const char *loc); 46 47 /** 48 * Create a new ULocaleBundle, initializing all formatters to 0. 49 * @param loc The locale of the ULocaleBundle. 50 * @return A pointer to a ULocaleBundle, or 0 if <TT>loc</TT> was invalid. 51 */ 52 /*U_CAPI ULocaleBundle * 53 u_locbund_new(const char *loc);*/ 54 55 /** 56 * Create a deep copy of this ULocaleBundle; 57 * @param bundle The ULocaleBundle to clone. 58 * @return A new ULocaleBundle. 59 */ 60 /*U_CAPI ULocaleBundle * 61 u_locbund_clone(const ULocaleBundle *bundle);*/ 62 63 /** 64 * Delete the specified ULocaleBundle, freeing all associated memory. 65 * @param bundle The ULocaleBundle to delete 66 */ 67 U_CAPI void 68 u_locbund_close(ULocaleBundle *bundle); 69 70 /** 71 * Get the NumberFormat used to format and parse numbers in a ULocaleBundle. 72 * @param bundle The ULocaleBundle to use 73 * @return A pointer to the NumberFormat used for number formatting and parsing. 74 */ 75 U_CAPI UNumberFormat * 76 u_locbund_getNumberFormat(ULocaleBundle *bundle, UNumberFormatStyle style); 77 78 #endif /* #if !UCONFIG_NO_FORMATTING */ 79 80 #endif 81