ICU 50.1.2  50.1.2
uldnames.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2010-2012, 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 {
39 
44 struct ULocaleDisplayNames;
45 
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
78 
79 #if U_SHOW_CPLUSPLUS_API
80 
82 
93 
95 
96 #endif
97 
98 /* getters for state */
99 
107 U_STABLE const char * U_EXPORT2
109 
116 U_STABLE UDialectHandling U_EXPORT2
118 
119 /* names for entire locales */
120 
132 U_STABLE int32_t U_EXPORT2
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
154  const char *lang,
155  UChar *result,
156  int32_t maxResultSize,
157  UErrorCode *pErrorCode);
158 
170 U_STABLE int32_t U_EXPORT2
172  const char *script,
173  UChar *result,
174  int32_t maxResultSize,
175  UErrorCode *pErrorCode);
176 
188 U_STABLE int32_t U_EXPORT2
190  UScriptCode scriptCode,
191  UChar *result,
192  int32_t maxResultSize,
193  UErrorCode *pErrorCode);
194 
206 U_STABLE int32_t U_EXPORT2
208  const char *region,
209  UChar *result,
210  int32_t maxResultSize,
211  UErrorCode *pErrorCode);
212 
224 U_STABLE int32_t U_EXPORT2
226  const char *variant,
227  UChar *result,
228  int32_t maxResultSize,
229  UErrorCode *pErrorCode);
230 
242 U_STABLE int32_t U_EXPORT2
244  const char *key,
245  UChar *result,
246  int32_t maxResultSize,
247  UErrorCode *pErrorCode);
248 
261 U_STABLE int32_t U_EXPORT2
263  const char *key,
264  const char *value,
265  UChar *result,
266  int32_t maxResultSize,
267  UErrorCode *pErrorCode);
268 
269 #ifndef U_HIDE_INTERNAL_API
270 
285 uldn_openForContext(const char * locale, UDisplayContext *contexts,
286  int32_t length, UErrorCode *pErrorCode);
287 
298 U_INTERNAL UDisplayContext U_EXPORT2
299 uldn_getContext(const ULocaleDisplayNames *ldn, UDisplayContextType type,
300  UErrorCode *pErrorCode);
301 
302 #endif /* U_HIDE_INTERNAL_API */
303 
304 #endif /* !UCONFIG_NO_FORMATTING */
305 #endif /* __ULDNAMES_H__ */
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.
UDialectHandling uldn_getDialectHandling(const ULocaleDisplayNames *ldn)
Returns the dialect handling used in the display names.
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.
UScriptCode
Constants for ISO 15924 script codes.
Definition: uscript.h:46
#define U_INTERNAL
This is used to declare a function as an internal ICU C API.
Definition: umachine.h:117
UDisplayContext uldn_getContext(const ULocaleDisplayNames *ldn, UDisplayContextType type, UErrorCode *pErrorCode)
Returns the UDisplayContext value for the specified UDisplayContextType.
C API: Unicode Script Information.
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.
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.
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
#define U_DEFINE_LOCAL_OPEN_POINTER(LocalPointerClassName, Type, closeFunction)
"Smart pointer" definition macro, deletes objects via the closeFunction.
Definition: localpointer.h:290
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...
C++ API: "Smart pointers" for use with and in ICU4C C++ code.
ULocaleDisplayNames * uldn_open(const char *locale, UDialectHandling dialectHandling, UErrorCode *pErrorCode)
Returns an instance of LocaleDisplayNames that returns names formatted for the provided locale...
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.
Use dialect names, when generating a locale name, e.g.
Definition: uldnames.h:37
struct ULocaleDisplayNames ULocaleDisplayNames
C typedef for struct ULocaleDisplayNames.
Definition: uldnames.h:50
Use standard names when generating a locale name, e.g.
Definition: uldnames.h:31
UDialectHandling
Enum used in LocaleDisplayNames::createInstance.
Definition: uldnames.h:25
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.
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:278
void uldn_close(ULocaleDisplayNames *ldn)
Closes a ULocaleDisplayNames instance obtained from uldn_open().
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.
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:476
const char * uldn_getLocale(const ULocaleDisplayNames *ldn)
Returns the locale used to determine the display names.
Basic definitions for ICU, for both C and C++ APIs.
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).
"Smart pointer" class, closes a ULocaleDisplayNames via uldn_close().
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:109