ICU 4.8.1.1  4.8.1.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
uldnames.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************
3 * Copyright (C) 2010, 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 
24 typedef enum {
38 
43 struct ULocaleDisplayNames;
44 
50 
51 #if !UCONFIG_NO_FORMATTING
52 
66 uldn_open(const char * locale,
67  UDialectHandling dialectHandling,
68  UErrorCode *pErrorCode);
69 
77 
78 #if U_SHOW_CPLUSPLUS_API
79 
81 
91 U_DEFINE_LOCAL_OPEN_POINTER(LocalULocaleDisplayNamesPointer, ULocaleDisplayNames, uldn_close);
92 
94 
95 #endif
96 
97 /* getters for state */
98 
106 U_STABLE const char * U_EXPORT2
108 
117 
118 /* names for entire locales */
119 
131 U_STABLE int32_t U_EXPORT2
133  const char *locale,
134  UChar *result,
135  int32_t maxResultSize,
136  UErrorCode *pErrorCode);
137 
138 /* names for components of a locale */
139 
151 U_STABLE int32_t U_EXPORT2
153  const char *lang,
154  UChar *result,
155  int32_t maxResultSize,
156  UErrorCode *pErrorCode);
157 
169 U_STABLE int32_t U_EXPORT2
171  const char *script,
172  UChar *result,
173  int32_t maxResultSize,
174  UErrorCode *pErrorCode);
175 
187 U_STABLE int32_t U_EXPORT2
189  UScriptCode scriptCode,
190  UChar *result,
191  int32_t maxResultSize,
192  UErrorCode *pErrorCode);
193 
205 U_STABLE int32_t U_EXPORT2
207  const char *region,
208  UChar *result,
209  int32_t maxResultSize,
210  UErrorCode *pErrorCode);
211 
223 U_STABLE int32_t U_EXPORT2
225  const char *variant,
226  UChar *result,
227  int32_t maxResultSize,
228  UErrorCode *pErrorCode);
229 
241 U_STABLE int32_t U_EXPORT2
243  const char *key,
244  UChar *result,
245  int32_t maxResultSize,
246  UErrorCode *pErrorCode);
247 
260 U_STABLE int32_t U_EXPORT2
262  const char *key,
263  const char *value,
264  UChar *result,
265  int32_t maxResultSize,
266  UErrorCode *pErrorCode);
267 
268 
269 #endif /* !UCONFIG_NO_FORMATTING */
270 #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
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:131
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:36
struct ULocaleDisplayNames ULocaleDisplayNames
C typedef for struct ULocaleDisplayNames.
Definition: uldnames.h:49
#define U_EXPORT2
Definition: platform.h:314
Use standard names when generating a locale name, e.g.
Definition: uldnames.h:30
UDialectHandling
Enum used in LocaleDisplayNames::createInstance.
Definition: uldnames.h:24
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 wchar_t if that is 16 bits wide; always assumed to be unsigned.
Definition: umachine.h:325
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:132
UErrorCode
Error code to replace exception handling, so that the code is compatible with all C++ compilers...
Definition: utypes.h:639
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).
#define U_STABLE
This is used to declare a function as a stable public ICU C API.
Definition: umachine.h:137