ICU 56.1: uldnames.h Source File

ICU 56.1 56.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- File List
- Globals

uldnames.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2010-2014, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
6 */
7
8 #ifndef __ULDNAMES_H__
9 #define __ULDNAMES_H__
10
16 #include "unicode/utypes.h"
17 #include "unicode/localpointer.h"
18 #include "unicode/uscript.h"
19 #include "unicode/udisplaycontext.h"
20
25 typedef enum {
31 ULDN_STANDARD_NAMES = 0,
37 ULDN_DIALECT_NAMES
38 } UDialectHandling;
39
44 struct ULocaleDisplayNames;
45
50 typedef struct ULocaleDisplayNames ULocaleDisplayNames;
51
52 #if !UCONFIG_NO_FORMATTING
53
66 U_STABLE ULocaleDisplayNames * U_EXPORT2
67 uldn_open(const char * locale,
68 UDialectHandling dialectHandling,
69 UErrorCode *pErrorCode);
70
76 U_STABLE void U_EXPORT2
77 uldn_close(ULocaleDisplayNames *ldn);
78
79 #if U_SHOW_CPLUSPLUS_API
80
81 U_NAMESPACE_BEGIN
82
92 U_DEFINE_LOCAL_OPEN_POINTER(LocalULocaleDisplayNamesPointer, ULocaleDisplayNames, uldn_close);
93
94 U_NAMESPACE_END
95
96 #endif
97
98 /* getters for state */
99
107 U_STABLE const char * U_EXPORT2
108 uldn_getLocale(const ULocaleDisplayNames *ldn);
109
116 U_STABLE UDialectHandling U_EXPORT2
117 uldn_getDialectHandling(const ULocaleDisplayNames *ldn);
118
119 /* names for entire locales */
120
132 U_STABLE int32_t U_EXPORT2
133 uldn_localeDisplayName(const ULocaleDisplayNames *ldn,
134 const char *locale,
135 UChar *result,
136 int32_t maxResultSize,
137 UErrorCode *pErrorCode);
138
139 /* names for components of a locale */
140
152 U_STABLE int32_t U_EXPORT2
153 uldn_languageDisplayName(const ULocaleDisplayNames *ldn,
154 const char *lang,
155 UChar *result,
156 int32_t maxResultSize,
157 UErrorCode *pErrorCode);
158
170 U_STABLE int32_t U_EXPORT2
171 uldn_scriptDisplayName(const ULocaleDisplayNames *ldn,
172 const char *script,
173 UChar *result,
174 int32_t maxResultSize,
175 UErrorCode *pErrorCode);
176
188 U_STABLE int32_t U_EXPORT2
189 uldn_scriptCodeDisplayName(const ULocaleDisplayNames *ldn,
190 UScriptCode scriptCode,
191 UChar *result,
192 int32_t maxResultSize,
193 UErrorCode *pErrorCode);
194
206 U_STABLE int32_t U_EXPORT2
207 uldn_regionDisplayName(const ULocaleDisplayNames *ldn,
208 const char *region,
209 UChar *result,
210 int32_t maxResultSize,
211 UErrorCode *pErrorCode);
212
224 U_STABLE int32_t U_EXPORT2
225 uldn_variantDisplayName(const ULocaleDisplayNames *ldn,
226 const char *variant,
227 UChar *result,
228 int32_t maxResultSize,
229 UErrorCode *pErrorCode);
230
242 U_STABLE int32_t U_EXPORT2
243 uldn_keyDisplayName(const ULocaleDisplayNames *ldn,
244 const char *key,
245 UChar *result,
246 int32_t maxResultSize,
247 UErrorCode *pErrorCode);
248
261 U_STABLE int32_t U_EXPORT2
262 uldn_keyValueDisplayName(const ULocaleDisplayNames *ldn,
263 const char *key,
264 const char *value,
265 UChar *result,
266 int32_t maxResultSize,
267 UErrorCode *pErrorCode);
268
283 U_STABLE ULocaleDisplayNames * U_EXPORT2
284 uldn_openForContext(const char * locale, UDisplayContext *contexts,
285 int32_t length, UErrorCode *pErrorCode);
286
297 U_STABLE UDisplayContext U_EXPORT2
298 uldn_getContext(const ULocaleDisplayNames *ldn, UDisplayContextType type,
299 UErrorCode *pErrorCode);
300
301 #endif /* !UCONFIG_NO_FORMATTING */
302 #endif /* __ULDNAMES_H__ */
uldn_keyDisplayName
int32_t uldn_keyDisplayName(const ULocaleDisplayNames *ldn, const char *key, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided locale key.
uldn_getDialectHandling
UDialectHandling uldn_getDialectHandling(const ULocaleDisplayNames *ldn)
Returns the dialect handling used in the display names.
uldn_localeDisplayName
int32_t uldn_localeDisplayName(const ULocaleDisplayNames *ldn, const char *locale, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided locale.
UDisplayContext
UDisplayContext
Display context settings.
Definition: udisplaycontext.h:56
UScriptCode
UScriptCode
Constants for ISO 15924 script codes.
Definition: uscript.h:52
udisplaycontext.h
C API: Display context types (enum values)
uldn_getContext
UDisplayContext uldn_getContext(const ULocaleDisplayNames *ldn, UDisplayContextType type, UErrorCode *pErrorCode)
Returns the UDisplayContext value for the specified UDisplayContextType.
uscript.h
C API: Unicode Script Information.
uldn_scriptDisplayName
int32_t uldn_scriptDisplayName(const ULocaleDisplayNames *ldn, const char *script, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided script.
uldn_regionDisplayName
int32_t uldn_regionDisplayName(const ULocaleDisplayNames *ldn, const char *region, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided region code.
U_NAMESPACE_BEGIN
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
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:535
uldn_openForContext
ULocaleDisplayNames * uldn_openForContext(const char *locale, UDisplayContext *contexts, int32_t length, UErrorCode *pErrorCode)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale...
localpointer.h
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
uldn_open
ULocaleDisplayNames * uldn_open(const char *locale, UDialectHandling dialectHandling, UErrorCode *pErrorCode)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale...
uldn_variantDisplayName
int32_t uldn_variantDisplayName(const ULocaleDisplayNames *ldn, const char *variant, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided variant.
ULDN_DIALECT_NAMES
Use dialect names, when generating a locale name, e.g.
Definition: uldnames.h:37
ULocaleDisplayNames
struct ULocaleDisplayNames ULocaleDisplayNames
C typedef for struct ULocaleDisplayNames.
Definition: uldnames.h:50
ULDN_STANDARD_NAMES
Use standard names when generating a locale name, e.g.
Definition: uldnames.h:31
UDialectHandling
UDialectHandling
Enum used in LocaleDisplayNames::createInstance.
Definition: uldnames.h:25
uldn_scriptCodeDisplayName
int32_t uldn_scriptCodeDisplayName(const ULocaleDisplayNames *ldn, UScriptCode scriptCode, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided script code.
UChar
uint16_t UChar
Define UChar to be UCHAR_TYPE, if that is #defined (for example, to char16_t), or wchar_t if that is ...
Definition: umachine.h:312
uldn_close
void uldn_close(ULocaleDisplayNames *ldn)
Closes a ULocaleDisplayNames instance obtained from uldn_open().
uldn_languageDisplayName
int32_t uldn_languageDisplayName(const ULocaleDisplayNames *ldn, const char *lang, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided language code.
U_NAMESPACE_END
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UDisplayContextType
UDisplayContextType
Display context types, for getting values of a particular setting.
Definition: udisplaycontext.h:25
UErrorCode
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
uldn_getLocale
const char * uldn_getLocale(const ULocaleDisplayNames *ldn)
Returns the locale used to determine the display names.
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
uldn_keyValueDisplayName
int32_t uldn_keyValueDisplayName(const ULocaleDisplayNames *ldn, const char *key, const char *value, UChar *result, int32_t maxResultSize, UErrorCode *pErrorCode)
Returns the display name of the provided value (used with the provided key).
LocalULocaleDisplayNamesPointer
"Smart pointer" class, closes a ULocaleDisplayNames via uldn_close().
U_STABLE
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109