#include <optional>
#include <string_view>
#include <utility>
#include "bytesinkutil.h"
#include "charstr.h"
#include "cstring.h"
#include "ulocimp.h"
#include "unicode/localebuilder.h"
#include "unicode/locid.h"
namespace {
inline bool UPRV_ISDIGIT(char c) { … }
inline bool UPRV_ISALPHANUM(char c) { … }
constexpr const char* kAttributeKey = …;
bool _isExtensionSubtags(char key, const char* s, int32_t len) { … }
}
U_NAMESPACE_BEGIN
LocaleBuilder::LocaleBuilder() : … { … }
LocaleBuilder::~LocaleBuilder()
{ … }
LocaleBuilder& LocaleBuilder::setLocale(const Locale& locale)
{ … }
LocaleBuilder& LocaleBuilder::setLanguageTag(StringPiece tag)
{ … }
namespace {
void setField(StringPiece input, char* dest, UErrorCode& errorCode,
bool (*test)(const char*, int32_t)) { … }
}
LocaleBuilder& LocaleBuilder::setLanguage(StringPiece language)
{ … }
LocaleBuilder& LocaleBuilder::setScript(StringPiece script)
{ … }
LocaleBuilder& LocaleBuilder::setRegion(StringPiece region)
{ … }
namespace {
void transform(char* data, int32_t len) { … }
}
LocaleBuilder& LocaleBuilder::setVariant(StringPiece variant)
{ … }
namespace {
bool
_isKeywordValue(const char* key, const char* value, int32_t value_len)
{ … }
void
_copyExtensions(const Locale& from, icu::StringEnumeration *keywords,
Locale& to, bool validate, UErrorCode& errorCode)
{ … }
void
_clearUAttributesAndKeyType(Locale& locale, UErrorCode& errorCode)
{ … }
void
_setUnicodeExtensions(Locale& locale, const CharString& value, UErrorCode& errorCode)
{ … }
}
LocaleBuilder& LocaleBuilder::setExtension(char key, StringPiece value)
{ … }
LocaleBuilder& LocaleBuilder::setUnicodeLocaleKeyword(
StringPiece key, StringPiece type)
{ … }
LocaleBuilder& LocaleBuilder::addUnicodeLocaleAttribute(
StringPiece value)
{ … }
LocaleBuilder& LocaleBuilder::removeUnicodeLocaleAttribute(
StringPiece value)
{ … }
LocaleBuilder& LocaleBuilder::clear()
{ … }
LocaleBuilder& LocaleBuilder::clearExtensions()
{ … }
Locale makeBogusLocale() { … }
void LocaleBuilder::copyExtensionsFrom(const Locale& src, UErrorCode& errorCode)
{ … }
Locale LocaleBuilder::build(UErrorCode& errorCode)
{ … }
UBool LocaleBuilder::copyErrorTo(UErrorCode &outErrorCode) const { … }
U_NAMESPACE_END