]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/ulocimp.h
ICU-62108.0.1.tar.gz
[apple/icu.git] / icuSources / common / ulocimp.h
CommitLineData
f3c0d7a5
A
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
374ca955
A
3/*
4**********************************************************************
2ca993e8 5* Copyright (C) 2004-2016, International Business Machines
374ca955
A
6* Corporation and others. All Rights Reserved.
7**********************************************************************
8*/
9
10#ifndef ULOCIMP_H
11#define ULOCIMP_H
12
13#include "unicode/uloc.h"
14
15/**
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.
21 * @internal ICU 3.0
22 */
23U_CAPI UEnumeration* U_EXPORT2
24uloc_openKeywordList(const char *keywordList, int32_t keywordListSize, UErrorCode* status);
25
729e4ab9
A
26/**
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.
29 */
30U_CAPI const UChar * U_EXPORT2
31uloc_getTableStringWithFallback(
32 const char *path,
33 const char *locale,
34 const char *tableKey,
35 const char *subTableKey,
36 const char *itemKey,
37 int32_t *pLength,
38 UErrorCode *pErrorCode);
39
40/*returns TRUE if a is an ID separator FALSE otherwise*/
41#define _isIDSeparator(a) (a == '_' || a == '-')
42
43U_CFUNC const char*
44uloc_getCurrentCountryID(const char* oldID);
45
46U_CFUNC const char*
47uloc_getCurrentLanguageID(const char* oldID);
48
49U_CFUNC int32_t
50ulocimp_getLanguage(const char *localeID,
51 char *language, int32_t languageCapacity,
52 const char **pEnd);
53
54U_CFUNC int32_t
55ulocimp_getScript(const char *localeID,
56 char *script, int32_t scriptCapacity,
57 const char **pEnd);
58
59U_CFUNC int32_t
60ulocimp_getCountry(const char *localeID,
61 char *country, int32_t countryCapacity,
62 const char **pEnd);
63
2ca993e8
A
64/**
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.
71 *
72 * @param localeID
73 * The complete locale ID (with keywords) from which
74 * to get the region to use for supplemental data.
75 * @param inferRegion
76 * If TRUE, will try to infer region from localeID if
77 * no other region is found.
78 * @param region
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.
83 * @param status
84 * Pointer to in/out UErrorCode value for latest status.
85 * @return
86 * The length of any region code found, or 0 if none.
87 * @internal ICU 57
88 */
89U_CAPI int32_t U_EXPORT2
90ulocimp_getRegionForSupplementalData(const char *localeID, UBool inferRegion,
91 char *region, int32_t regionCapacity, UErrorCode* status);
92
729e4ab9
A
93U_CAPI const char * U_EXPORT2
94locale_getKeywordsStart(const char *localeID);
95
b331163b
A
96
97U_CFUNC UBool
98ultag_isUnicodeLocaleKey(const char* s, int32_t len);
99
100U_CFUNC UBool
101ultag_isUnicodeLocaleType(const char* s, int32_t len);
102
103U_CFUNC const char*
104ulocimp_toBcpKey(const char* key);
105
106U_CFUNC const char*
107ulocimp_toLegacyKey(const char* key);
108
109U_CFUNC const char*
110ulocimp_toBcpType(const char* key, const char* type, UBool* isKnownKey, UBool* isSpecialType);
111
112U_CFUNC const char*
113ulocimp_toLegacyType(const char* key, const char* type, UBool* isKnownKey, UBool* isSpecialType);
114
374ca955 115#endif