ICU 74.2: i18n/unicode/ulocdata.h Source File

ICU 74.2 74.2

ulocdata.h
Go to the documentation of this file.
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/*
4******************************************************************************
5* *
6* Copyright (C) 2003-2015, International Business Machines *
7* Corporation and others. All Rights Reserved. *
8* *
9******************************************************************************
10* file name: ulocdata.h
11* encoding: UTF-8
12* tab size: 8 (not used)
13* indentation:4
14*
15* created on: 2003Oct21
16* created by: Ram Viswanadha
17*/
18
19#ifndef __ULOCDATA_H__
20#define __ULOCDATA_H__
21
22#include "unicode/ures.h"
23#include "unicode/uloc.h"
24#include "unicode/uset.h"
25
26#if U_SHOW_CPLUSPLUS_API
27#include "unicode/localpointer.h"
28#endif // U_SHOW_CPLUSPLUS_API
29
36struct ULocaleData;
37
39 typedef struct ULocaleData ULocaleData;
40
41
42
46 typedef enum ULocaleDataExemplarSetType {
48 ULOCDATA_ES_STANDARD=0,
50 ULOCDATA_ES_AUXILIARY=1,
52 ULOCDATA_ES_INDEX=2,
54 ULOCDATA_ES_PUNCTUATION=3,
55#ifndef U_HIDE_DEPRECATED_API
60 ULOCDATA_ES_COUNT=4
61#endif /* U_HIDE_DEPRECATED_API */
62} ULocaleDataExemplarSetType;
63
67 typedef enum ULocaleDataDelimiterType {
69 ULOCDATA_QUOTATION_START = 0,
71 ULOCDATA_QUOTATION_END = 1,
73 ULOCDATA_ALT_QUOTATION_START = 2,
75 ULOCDATA_ALT_QUOTATION_END = 3,
76#ifndef U_HIDE_DEPRECATED_API
81 ULOCDATA_DELIMITER_COUNT = 4
82#endif /* U_HIDE_DEPRECATED_API */
83} ULocaleDataDelimiterType;
84
93 U_CAPI ULocaleData* U_EXPORT2
94ulocdata_open(const char *localeID, UErrorCode *status);
95
102 U_CAPI void U_EXPORT2
103ulocdata_close(ULocaleData *uld);
104
105#if U_SHOW_CPLUSPLUS_API
106
107U_NAMESPACE_BEGIN
108
118 U_DEFINE_LOCAL_OPEN_POINTER(LocalULocaleDataPointer, ULocaleData, ulocdata_close);
119
120U_NAMESPACE_END
121
122#endif
123
135 U_CAPI void U_EXPORT2
136ulocdata_setNoSubstitute(ULocaleData *uld, UBool setting);
137
149 U_CAPI UBool U_EXPORT2
150ulocdata_getNoSubstitute(ULocaleData *uld);
151
179 U_CAPI USet* U_EXPORT2
180ulocdata_getExemplarSet(ULocaleData *uld, USet *fillIn,
181 uint32_t options, ULocaleDataExemplarSetType extype, UErrorCode *status);
182
196 U_CAPI int32_t U_EXPORT2
197ulocdata_getDelimiter(ULocaleData *uld, ULocaleDataDelimiterType type, UChar *result, int32_t resultLength, UErrorCode *status);
198
203 typedef enum UMeasurementSystem {
204 UMS_SI,
205 UMS_US,
206 UMS_UK,
207#ifndef U_HIDE_DEPRECATED_API
212 UMS_LIMIT
213#endif /* U_HIDE_DEPRECATED_API */
214} UMeasurementSystem;
215
226 U_CAPI UMeasurementSystem U_EXPORT2
227ulocdata_getMeasurementSystem(const char *localeID, UErrorCode *status);
228
245 U_CAPI void U_EXPORT2
246ulocdata_getPaperSize(const char *localeID, int32_t *height, int32_t *width, UErrorCode *status);
247
254 U_CAPI void U_EXPORT2
255ulocdata_getCLDRVersion(UVersionInfo versionArray, UErrorCode *status);
256
272 U_CAPI int32_t U_EXPORT2
273ulocdata_getLocaleDisplayPattern(ULocaleData *uld,
274 UChar *pattern,
275 int32_t patternCapacity,
276 UErrorCode *status);
277
278
294 U_CAPI int32_t U_EXPORT2
295ulocdata_getLocaleSeparator(ULocaleData *uld,
296 UChar *separator,
297 int32_t separatorCapacity,
298 UErrorCode *status);
299#endif
LocalULocaleDataPointer
"Smart pointer" class, closes a ULocaleData via ulocdata_close().
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
U_DEFINE_LOCAL_OPEN_POINTER
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition localpointer.h:550
uloc.h
C API: Locale ID functionality similar to C++ class Locale.
ulocdata_getDelimiter
U_CAPI int32_t ulocdata_getDelimiter(ULocaleData *uld, ULocaleDataDelimiterType type, UChar *result, int32_t resultLength, UErrorCode *status)
Returns one of the delimiter strings associated with a locale.
ULocaleData
struct ULocaleData ULocaleData
A locale data object.
Definition ulocdata.h:39
ULocaleDataDelimiterType
ULocaleDataDelimiterType
The possible types of delimiters.
Definition ulocdata.h:67
ULOCDATA_QUOTATION_END
@ ULOCDATA_QUOTATION_END
Quotation end.
Definition ulocdata.h:71
ULOCDATA_DELIMITER_COUNT
@ ULOCDATA_DELIMITER_COUNT
One more than the highest normal ULocaleDataDelimiterType value.
Definition ulocdata.h:81
ULOCDATA_QUOTATION_START
@ ULOCDATA_QUOTATION_START
Quotation start.
Definition ulocdata.h:69
ULOCDATA_ALT_QUOTATION_END
@ ULOCDATA_ALT_QUOTATION_END
Alternate quotation end.
Definition ulocdata.h:75
ULOCDATA_ALT_QUOTATION_START
@ ULOCDATA_ALT_QUOTATION_START
Alternate quotation start.
Definition ulocdata.h:73
ulocdata_getLocaleSeparator
U_CAPI int32_t ulocdata_getLocaleSeparator(ULocaleData *uld, UChar *separator, int32_t separatorCapacity, UErrorCode *status)
Returns locale separator associated with a locale.
ulocdata_getLocaleDisplayPattern
U_CAPI int32_t ulocdata_getLocaleDisplayPattern(ULocaleData *uld, UChar *pattern, int32_t patternCapacity, UErrorCode *status)
Returns locale display pattern associated with a locale.
ulocdata_setNoSubstitute
U_CAPI void ulocdata_setNoSubstitute(ULocaleData *uld, UBool setting)
Sets the "no Substitute" attribute of the locale data object.
UMeasurementSystem
UMeasurementSystem
Enumeration for representing the measurement systems.
Definition ulocdata.h:203
UMS_UK
@ UMS_UK
Mix of metric and imperial units used in Great Britain.
Definition ulocdata.h:206
UMS_US
@ UMS_US
Measurement system followed in the United States of America.
Definition ulocdata.h:205
UMS_SI
@ UMS_SI
Measurement system specified by SI otherwise known as Metric system.
Definition ulocdata.h:204
UMS_LIMIT
@ UMS_LIMIT
One more than the highest normal UMeasurementSystem value.
Definition ulocdata.h:212
ulocdata_getCLDRVersion
U_CAPI void ulocdata_getCLDRVersion(UVersionInfo versionArray, UErrorCode *status)
Return the current CLDR version used by the library.
ulocdata_close
U_CAPI void ulocdata_close(ULocaleData *uld)
Closes a locale data object.
ulocdata_getMeasurementSystem
U_CAPI UMeasurementSystem ulocdata_getMeasurementSystem(const char *localeID, UErrorCode *status)
Returns the measurement system used in the locale specified by the localeID.
ulocdata_getPaperSize
U_CAPI void ulocdata_getPaperSize(const char *localeID, int32_t *height, int32_t *width, UErrorCode *status)
Returns the element gives the normal business letter size, and customary units.
ULocaleDataExemplarSetType
ULocaleDataExemplarSetType
The possible types of exemplar character sets.
Definition ulocdata.h:46
ULOCDATA_ES_COUNT
@ ULOCDATA_ES_COUNT
One more than the highest normal ULocaleDataExemplarSetType value.
Definition ulocdata.h:60
ULOCDATA_ES_STANDARD
@ ULOCDATA_ES_STANDARD
Basic set.
Definition ulocdata.h:48
ULOCDATA_ES_INDEX
@ ULOCDATA_ES_INDEX
Index Character set.
Definition ulocdata.h:52
ULOCDATA_ES_AUXILIARY
@ ULOCDATA_ES_AUXILIARY
Auxiliary set.
Definition ulocdata.h:50
ULOCDATA_ES_PUNCTUATION
@ ULOCDATA_ES_PUNCTUATION
Punctuation set.
Definition ulocdata.h:54
ulocdata_open
U_CAPI ULocaleData * ulocdata_open(const char *localeID, UErrorCode *status)
Opens a locale data object for the given locale.
ulocdata_getNoSubstitute
U_CAPI UBool ulocdata_getNoSubstitute(ULocaleData *uld)
Retrieves the current "no Substitute" value of the locale data object.
ulocdata_getExemplarSet
U_CAPI USet * ulocdata_getExemplarSet(ULocaleData *uld, USet *fillIn, uint32_t options, ULocaleDataExemplarSetType extype, UErrorCode *status)
Returns the set of exemplar characters for a locale.
UBool
int8_t UBool
The ICU boolean type, a signed-byte integer.
Definition umachine.h:247
U_CAPI
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition umachine.h:110
UChar
char16_t UChar
The base type for UTF-16 code units and pointers.
Definition umachine.h:386
ures.h
C API: Resource Bundle.
uset.h
C API: Unicode Set.
USet
struct USet USet
USet is the C API type corresponding to C++ class UnicodeSet.
Definition uset.h:50
UErrorCode
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition utypes.h:415
UVersionInfo
uint8_t UVersionInfo[U_MAX_VERSION_LENGTH]
The binary form of a version on ICU APIs is an array of 4 uint8_t.
Definition uversion.h:59