ICU 75.1 75.1
Loading...
Searching...
No Matches
ulocale.h
Go to the documentation of this file.
1// © 2023 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3
4#ifndef ULOCALE_H
5#define ULOCALE_H
6
8#include "unicode/uenum.h"
9#include "unicode/utypes.h"
10
16#ifndef U_HIDE_DRAFT_API
21struct ULocale;
22
27typedef struct ULocale ULocale;
28
42U_CAPI ULocale* U_EXPORT2
43ulocale_openForLocaleID(const char* localeID, int32_t length, UErrorCode* err);
44
58U_CAPI ULocale* U_EXPORT2
59ulocale_openForLanguageTag(const char* tag, int32_t length, UErrorCode* err);
60
67U_CAPI void U_EXPORT2
69
77U_CAPI const char* U_EXPORT2
79
87U_CAPI const char* U_EXPORT2
89
97U_CAPI const char* U_EXPORT2
99
107U_CAPI const char* U_EXPORT2
109
120U_CAPI const char* U_EXPORT2
122
131U_CAPI const char* U_EXPORT2
133
141U_CAPI bool U_EXPORT2
143
153U_CAPI UEnumeration* U_EXPORT2
155
165U_CAPI UEnumeration* U_EXPORT2
167
183U_CAPI int32_t U_EXPORT2
185 const ULocale* locale, const char* keyword, int32_t keywordLength,
186 char* valueBuffer, int32_t valueBufferCapacity, UErrorCode *err);
187
203U_CAPI int32_t U_EXPORT2
205 const ULocale* locale, const char* keyword, int32_t keywordLength,
206 char* valueBuffer, int32_t valueBufferCapacity, UErrorCode *err);
207
208#if U_SHOW_CPLUSPLUS_API
209
210U_NAMESPACE_BEGIN
211
222
223U_NAMESPACE_END
224
225#endif /* U_SHOW_CPLUSPLUS_API */
226
227#endif /* U_HIDE_DRAFT_API */
228
229#endif /*_ULOCALE */
"Smart pointer" class, closes a ULocale via ulocale_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: String Enumeration.
struct UEnumeration UEnumeration
structure representing an enumeration object instance
Definition uenum.h:44
U_CAPI const char * ulocale_getVariant(const ULocale *locale)
Returns the locale's variant code.
U_CAPI const char * ulocale_getBaseName(const ULocale *locale)
Returns the programmatic name of the entire locale as ulocale_getLocaleID() would return,...
U_CAPI UEnumeration * ulocale_getKeywords(const ULocale *locale, UErrorCode *err)
Gets the list of keywords for the specified locale.
U_CAPI UEnumeration * ulocale_getUnicodeKeywords(const ULocale *locale, UErrorCode *err)
Gets the list of unicode keywords for the specified locale.
U_CAPI const char * ulocale_getRegion(const ULocale *locale)
Returns the locale's ISO-3166 region code.
U_CAPI const char * ulocale_getScript(const ULocale *locale)
Returns the locale's ISO-15924 abbreviation script code.
struct ULocale ULocale
C typedef for struct ULocale.
Definition ulocale.h:27
U_CAPI ULocale * ulocale_openForLocaleID(const char *localeID, int32_t length, UErrorCode *err)
Constructs an ULocale from the locale ID.
U_CAPI int32_t ulocale_getUnicodeKeywordValue(const ULocale *locale, const char *keyword, int32_t keywordLength, char *valueBuffer, int32_t valueBufferCapacity, UErrorCode *err)
Gets the Unicode value for a Unicode keyword.
U_CAPI ULocale * ulocale_openForLanguageTag(const char *tag, int32_t length, UErrorCode *err)
Constructs an ULocale from the provided IETF BCP 47 language tag.
U_CAPI bool ulocale_isBogus(const ULocale *locale)
Gets the bogus state.
U_CAPI const char * ulocale_getLocaleID(const ULocale *locale)
Returns the programmatic name of the entire locale, with the language, country and variant separated ...
U_CAPI const char * ulocale_getLanguage(const ULocale *locale)
Returns the locale's ISO-639 language code.
U_CAPI void ulocale_close(ULocale *locale)
Close the locale and destroy it's internal states.
U_CAPI int32_t ulocale_getKeywordValue(const ULocale *locale, const char *keyword, int32_t keywordLength, char *valueBuffer, int32_t valueBufferCapacity, UErrorCode *err)
Gets the value for a keyword.
#define U_CAPI
This is used to declare a function as a public ICU C API.
Definition umachine.h:110
Basic definitions for ICU, for both C and C++ APIs.
UErrorCode
Standard ICU4C error code type, a substitute for exceptions.
Definition utypes.h:415