#ifndef ULOCIMP_H
#define ULOCIMP_H
#include <cstddef>
#include <optional>
#include <string_view>
#include "unicode/bytestream.h"
#include "unicode/uloc.h"
#include "charstr.h"
U_CAPI UEnumeration* U_EXPORT2
uloc_openKeywordList(const char *keywordList, int32_t keywordListSize, UErrorCode* status);
U_CAPI const UChar * U_EXPORT2
uloc_getTableStringWithFallback(
const char *path,
const char *locale,
const char *tableKey,
const char *subTableKey,
const char *itemKey,
int32_t *pLength,
UErrorCode *pErrorCode);
namespace {
inline bool _isIDSeparator(char a) { … }
}
U_CFUNC const char*
uloc_getCurrentCountryID(const char* oldID);
U_CFUNC const char*
uloc_getCurrentLanguageID(const char* oldID);
U_EXPORT std::optional<std::string_view>
ulocimp_toBcpKeyWithFallback(std::string_view keyword);
U_EXPORT std::optional<std::string_view>
ulocimp_toBcpTypeWithFallback(std::string_view keyword, std::string_view value);
U_EXPORT std::optional<std::string_view>
ulocimp_toLegacyKeyWithFallback(std::string_view keyword);
U_EXPORT std::optional<std::string_view>
ulocimp_toLegacyTypeWithFallback(std::string_view keyword, std::string_view value);
U_EXPORT icu::CharString
ulocimp_getKeywords(const char* localeID,
char prev,
bool valuesToo,
UErrorCode& status);
U_EXPORT void
ulocimp_getKeywords(const char* localeID,
char prev,
icu::ByteSink& sink,
bool valuesToo,
UErrorCode& status);
U_EXPORT icu::CharString
ulocimp_getName(const char* localeID,
UErrorCode& err);
U_EXPORT void
ulocimp_getName(const char* localeID,
icu::ByteSink& sink,
UErrorCode& err);
U_EXPORT icu::CharString
ulocimp_getBaseName(const char* localeID,
UErrorCode& err);
U_EXPORT void
ulocimp_getBaseName(const char* localeID,
icu::ByteSink& sink,
UErrorCode& err);
U_EXPORT icu::CharString
ulocimp_canonicalize(const char* localeID,
UErrorCode& err);
U_EXPORT void
ulocimp_canonicalize(const char* localeID,
icu::ByteSink& sink,
UErrorCode& err);
U_EXPORT icu::CharString
ulocimp_getKeywordValue(const char* localeID,
std::string_view keywordName,
UErrorCode& status);
U_EXPORT void
ulocimp_getKeywordValue(const char* localeID,
std::string_view keywordName,
icu::ByteSink& sink,
UErrorCode& status);
U_EXPORT icu::CharString
ulocimp_getLanguage(const char* localeID, UErrorCode& status);
U_EXPORT icu::CharString
ulocimp_getScript(const char* localeID, UErrorCode& status);
U_EXPORT icu::CharString
ulocimp_getRegion(const char* localeID, UErrorCode& status);
U_EXPORT icu::CharString
ulocimp_getVariant(const char* localeID, UErrorCode& status);
U_EXPORT void
ulocimp_setKeywordValue(std::string_view keywordName,
std::string_view keywordValue,
icu::CharString& localeID,
UErrorCode& status);
U_EXPORT int32_t
ulocimp_setKeywordValue(std::string_view keywords,
std::string_view keywordName,
std::string_view keywordValue,
icu::ByteSink& sink,
UErrorCode& status);
U_EXPORT void
ulocimp_getSubtags(
const char* localeID,
icu::CharString* language,
icu::CharString* script,
icu::CharString* region,
icu::CharString* variant,
const char** pEnd,
UErrorCode& status);
U_EXPORT void
ulocimp_getSubtags(
const char* localeID,
icu::ByteSink* language,
icu::ByteSink* script,
icu::ByteSink* region,
icu::ByteSink* variant,
const char** pEnd,
UErrorCode& status);
inline void
ulocimp_getSubtags(
const char* localeID,
std::nullptr_t,
std::nullptr_t,
std::nullptr_t,
std::nullptr_t,
const char** pEnd,
UErrorCode& status) { … }
U_EXPORT icu::CharString
ulocimp_getParent(const char* localeID,
UErrorCode& err);
U_EXPORT void
ulocimp_getParent(const char* localeID,
icu::ByteSink& sink,
UErrorCode& err);
U_EXPORT icu::CharString
ulocimp_toLanguageTag(const char* localeID,
bool strict,
UErrorCode& status);
U_EXPORT void
ulocimp_toLanguageTag(const char* localeID,
icu::ByteSink& sink,
bool strict,
UErrorCode& err);
U_EXPORT icu::CharString
ulocimp_forLanguageTag(const char* langtag,
int32_t tagLen,
int32_t* parsedLength,
UErrorCode& status);
U_EXPORT void
ulocimp_forLanguageTag(const char* langtag,
int32_t tagLen,
icu::ByteSink& sink,
int32_t* parsedLength,
UErrorCode& err);
U_EXPORT icu::CharString
ulocimp_getRegionForSupplementalData(const char *localeID, bool inferRegion,
UErrorCode& status);
U_EXPORT icu::CharString
ulocimp_addLikelySubtags(const char* localeID,
UErrorCode& status);
U_EXPORT void
ulocimp_addLikelySubtags(const char* localeID,
icu::ByteSink& sink,
UErrorCode& err);
U_EXPORT icu::CharString
ulocimp_minimizeSubtags(const char* localeID,
bool favorScript,
UErrorCode& status);
U_EXPORT void
ulocimp_minimizeSubtags(const char* localeID,
icu::ByteSink& sink,
bool favorScript,
UErrorCode& err);
U_CAPI const char * U_EXPORT2
locale_getKeywordsStart(const char *localeID);
bool
ultag_isExtensionSubtags(const char* s, int32_t len);
bool
ultag_isLanguageSubtag(const char* s, int32_t len);
bool
ultag_isPrivateuseValueSubtags(const char* s, int32_t len);
bool
ultag_isRegionSubtag(const char* s, int32_t len);
bool
ultag_isScriptSubtag(const char* s, int32_t len);
bool
ultag_isTransformedExtensionSubtags(const char* s, int32_t len);
bool
ultag_isUnicodeExtensionSubtags(const char* s, int32_t len);
bool
ultag_isUnicodeLocaleAttribute(const char* s, int32_t len);
bool
ultag_isUnicodeLocaleAttributes(const char* s, int32_t len);
bool
ultag_isUnicodeLocaleKey(const char* s, int32_t len);
bool
ultag_isUnicodeLocaleType(const char* s, int32_t len);
bool
ultag_isVariantSubtags(const char* s, int32_t len);
const char*
ultag_getTKeyStart(const char* localeID);
U_EXPORT std::optional<std::string_view>
ulocimp_toBcpKey(std::string_view key);
U_EXPORT std::optional<std::string_view>
ulocimp_toLegacyKey(std::string_view key);
U_EXPORT std::optional<std::string_view>
ulocimp_toBcpType(std::string_view key, std::string_view type);
U_EXPORT std::optional<std::string_view>
ulocimp_toLegacyType(std::string_view key, std::string_view type);
U_EXPORT const char* const*
ulocimp_getKnownCanonicalizedLocaleForTest(int32_t& length);
U_EXPORT bool
ulocimp_isCanonicalizedLocaleForTest(const char* localeName);
#ifdef __cplusplus
U_NAMESPACE_BEGIN
class U_COMMON_API RegionValidateMap : public UObject { … };
U_NAMESPACE_END
#endif
#endif