ICU 62.1 62.1
uldnames.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* Copyright (C) 2010-2016, International Business Machines Corporation and
6* others. All Rights Reserved.
7*******************************************************************************
8*/
9
10#ifndef __ULDNAMES_H__
11#define __ULDNAMES_H__
12
18#include "unicode/utypes.h"
20#include "unicode/uscript.h"
22
41
47
53
54#if !UCONFIG_NO_FORMATTING
55
69uldn_open(const char * locale,
70 UDialectHandling dialectHandling,
71 UErrorCode *pErrorCode);
72
78U_STABLE void U_EXPORT2
80
81#if U_SHOW_CPLUSPLUS_API
82
84
95
97
98#endif
99
100/* getters for state */
101
109U_STABLE const char * U_EXPORT2
111
120
121/* names for entire locales */
122
134U_STABLE int32_t U_EXPORT2
136 const char *locale,
137 UChar *result,
138 int32_t maxResultSize,
139 UErrorCode *pErrorCode);
140
141/* names for components of a locale */
142
154U_STABLE int32_t U_EXPORT2
156 const char *lang,
157 UChar *result,
158 int32_t maxResultSize,
159 UErrorCode *pErrorCode);
160
172U_STABLE int32_t U_EXPORT2
174 const char *script,
175 UChar *result,
176 int32_t maxResultSize,
177 UErrorCode *pErrorCode);
178
190U_STABLE int32_t U_EXPORT2
192 UScriptCode scriptCode,
193 UChar *result,
194 int32_t maxResultSize,
195 UErrorCode *pErrorCode);
196
208U_STABLE int32_t U_EXPORT2
210 const char *region,
211 UChar *result,
212 int32_t maxResultSize,
213 UErrorCode *pErrorCode);
214
226U_STABLE int32_t U_EXPORT2
228 const char *variant,
229 UChar *result,
230 int32_t maxResultSize,
231 UErrorCode *pErrorCode);
232
244U_STABLE int32_t U_EXPORT2
246 const char *key,
247 UChar *result,
248 int32_t maxResultSize,
249 UErrorCode *pErrorCode);
250
263U_STABLE int32_t U_EXPORT2
265 const char *key,
266 const char *value,
267 UChar *result,
268 int32_t maxResultSize,
269 UErrorCode *pErrorCode);
270
286uldn_openForContext(const char * locale, UDisplayContext *contexts,
287 int32_t length, UErrorCode *pErrorCode);
288
301 UErrorCode *pErrorCode);
302
303#endif /* !UCONFIG_NO_FORMATTING */
304#endif /* __ULDNAMES_H__ */
"Smart pointer" class, closes a ULocaleDisplayNames via uldn_close().
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
C API: Display context types (enum values)
UDisplayContextType
Display context types, for getting values of a particular setting.
UDisplayContext
Display context settings.
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.
struct ULocaleDisplayNames ULocaleDisplayNames
C typedef for struct ULocaleDisplayNames.
Definition uldnames.h:52
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.
ULocaleDisplayNames * uldn_open(const char *locale, UDialectHandling dialectHandling, UErrorCode *pErrorCode)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale,...
UDialectHandling
Enum used in LocaleDisplayNames::createInstance.
Definition uldnames.h:27
@ ULDN_DIALECT_NAMES
Use dialect names, when generating a locale name, e.g.
Definition uldnames.h:39
@ ULDN_STANDARD_NAMES
Use standard names when generating a locale name, e.g.
Definition uldnames.h:33
UDialectHandling uldn_getDialectHandling(const ULocaleDisplayNames *ldn)
Returns the dialect handling used in the display names.
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).
UDisplayContext uldn_getContext(const ULocaleDisplayNames *ldn, UDisplayContextType type, UErrorCode *pErrorCode)
Returns the UDisplayContext value for the specified UDisplayContextType.
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.
void uldn_close(ULocaleDisplayNames *ldn)
Closes a ULocaleDisplayNames instance obtained from uldn_open().
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.
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.
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.
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,...
const char * uldn_getLocale(const ULocaleDisplayNames *ldn)
Returns the locale used to determine the display names.
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.
uint16_t UChar
The base type for UTF-16 code units and pointers.
Definition umachine.h:353
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition umachine.h:111
C API: Unicode Script Information.
UScriptCode
Constants for ISO 15924 script codes.
Definition uscript.h:54
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers,...
Definition utypes.h:396
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition uversion.h:138
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition uversion.h:137