]>
git.saurik.com Git - apple/icu.git/blob - icuSources/common/ulocimp.h
1 // © 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
4 **********************************************************************
5 * Copyright (C) 2004-2016, International Business Machines
6 * Corporation and others. All Rights Reserved.
7 **********************************************************************
13 #include "unicode/uloc.h"
16 * Create an iterator over the specified keywords list
17 * @param keywordList double-null terminated list. Will be copied.
18 * @param keywordListSize size in bytes of keywordList
19 * @param status err code
20 * @return enumeration (owned by caller) of the keyword list.
23 U_CAPI UEnumeration
* U_EXPORT2
24 uloc_openKeywordList(const char *keywordList
, int32_t keywordListSize
, UErrorCode
* status
);
27 * Look up a resource bundle table item with fallback on the table level.
28 * This is accessible so it can be called by C++ code.
30 U_CAPI
const UChar
* U_EXPORT2
31 uloc_getTableStringWithFallback(
35 const char *subTableKey
,
38 UErrorCode
*pErrorCode
);
40 /*returns TRUE if a is an ID separator FALSE otherwise*/
41 #define _isIDSeparator(a) (a == '_' || a == '-')
44 uloc_getCurrentCountryID(const char* oldID
);
47 uloc_getCurrentLanguageID(const char* oldID
);
50 ulocimp_getLanguage(const char *localeID
,
51 char *language
, int32_t languageCapacity
,
55 ulocimp_getScript(const char *localeID
,
56 char *script
, int32_t scriptCapacity
,
60 ulocimp_getCountry(const char *localeID
,
61 char *country
, int32_t countryCapacity
,
65 * Get the region to use for supplemental data lookup. Uses
66 * (1) any region specified by locale tag "rg"; if none then
67 * (2) any unicode_region_tag in the locale ID; if none then
68 * (3) if inferRegion is TRUE, the region suggested by
69 * getLikelySubtags on the localeID.
70 * If no region is found, returns length 0.
73 * The complete locale ID (with keywords) from which
74 * to get the region to use for supplemental data.
76 * If TRUE, will try to infer region from localeID if
77 * no other region is found.
79 * Buffer in which to put the region ID found; should
80 * have a capacity at least ULOC_COUNTRY_CAPACITY.
81 * @param regionCapacity
82 * The actual capacity of the region buffer.
84 * Pointer to in/out UErrorCode value for latest status.
86 * The length of any region code found, or 0 if none.
89 U_CAPI
int32_t U_EXPORT2
90 ulocimp_getRegionForSupplementalData(const char *localeID
, UBool inferRegion
,
91 char *region
, int32_t regionCapacity
, UErrorCode
* status
);
93 U_CAPI
const char * U_EXPORT2
94 locale_getKeywordsStart(const char *localeID
);
98 ultag_isUnicodeLocaleKey(const char* s
, int32_t len
);
101 ultag_isUnicodeLocaleType(const char* s
, int32_t len
);
104 ulocimp_toBcpKey(const char* key
);
107 ulocimp_toLegacyKey(const char* key
);
110 ulocimp_toBcpType(const char* key
, const char* type
, UBool
* isKnownKey
, UBool
* isSpecialType
);
113 ulocimp_toLegacyType(const char* key
, const char* type
, UBool
* isKnownKey
, UBool
* isSpecialType
);