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