Lines Matching defs:other

44 int8_t LocaleMatcher::IsMoreSuitable(const LocaleInfo *current, const LocaleInfo *other, const LocaleInfo *request)
48 if (current != nullptr && other == nullptr) {
49 // -1 means other is more suitable
52 if (current == nullptr && other != nullptr) {
58 if (current == nullptr && other == nullptr) {
61 bool isLangEqual = CompareLanguage(current, other);
63 // current or other language is null, not null language is better
64 bool result = CompareRegionWhenLangIsNotEqual(current, other, request);
70 LocaleUtil::EncodeRegionByLocaleInfo(other);
73 return CompareLanguageIgnoreOldNewCode(current, other, request);
83 int8_t isRegionEqual = CompareRegion(current, other, request);
85 return CompareLanguageIgnoreOldNewCode(current, other, request);
90 bool LocaleMatcher::CompareLanguage(const LocaleInfo *current, const LocaleInfo *other)
93 uint16_t otherEncodedLanguage = LocaleUtil::EncodeLanguageByLocaleInfo(other);
118 bool LocaleMatcher::CompareRegionWhenLangIsNotEqual(const LocaleInfo *current, const LocaleInfo *other,
121 int8_t qaagResult = CompareRegionWhenQaag(current, other, request);
133 return !(other->GetRegion().length() == 0 ||
134 ((LocaleUtil::EncodeRegion(other->GetRegion().c_str())) == LocaleUtil::EncodeRegion("US")));
140 return !IsSimilarToUsEnglish(other);
147 int8_t LocaleMatcher::CompareRegionWhenQaag(const LocaleInfo *current, const LocaleInfo *other,
156 if ((other != nullptr) && (LocaleUtil::EncodeLocale(other->GetLanguage().c_str(), nullptr,
157 other->GetRegion().c_str()) == LocaleMatcher::EN_GB_ENCODE)) {
232 int8_t LocaleMatcher::CompareRegion(const LocaleInfo *current, const LocaleInfo *other, const LocaleInfo *request)
235 uint16_t otherEncodedRegion = LocaleUtil::EncodeRegionByLocaleInfo(other);
237 return CompareWhenRegionIsNull(currentEncodedRegion, otherEncodedRegion, current, other, request);
246 (other == nullptr) ? nullptr : other->GetRegion().c_str());
261 result = CompareDefaultRegion(current, other, request);
273 return AlphabeticallyCompare(current, currentEncodedLocale, other, otherEncodedLocale);
277 const LocaleInfo *current, const LocaleInfo *other, const LocaleInfo *request)
282 if (other == nullptr || other->GetRegion().length() == 0) {
285 int8_t qaagResult = CompareRegionWhenQaag(current, other, request);
299 // current and other region is not null.alphabetically
304 (request == nullptr) ? nullptr : request->GetLanguage().c_str(), nullptr, other->GetRegion().c_str());
305 return AlphabeticallyCompare(current, currentEncodedLocale, other, otherEncodedLocale);
333 const LocaleInfo *other, uint64_t otherEncodedLocale)
341 if (other == nullptr || other->GetRegion().length() == 0) {
346 char otherFirstChar = (other->GetRegion())[0];
415 int8_t LocaleMatcher::CompareDefaultRegion(const LocaleInfo *current, const LocaleInfo *other,
418 int8_t qaagResult = CompareRegionWhenQaag(current, other, request);
427 (other == nullptr) ? nullptr : other->GetRegion().c_str());
453 int8_t LocaleMatcher::CompareLanguageIgnoreOldNewCode(const LocaleInfo *current, const LocaleInfo *other,
457 uint16_t otherLanguageEncode = LocaleUtil::EncodeLanguageByLocaleInfo(other);
468 bool LocaleMatcher::Match(const LocaleInfo *current, const LocaleInfo *other)
470 if (current == nullptr || other == nullptr) {
474 bool isLanguageEqual = CompareLanguage(current, other);
478 return CompareScript(current, other);
481 bool LocaleMatcher::CompareScript(const LocaleInfo *current, const LocaleInfo *other)
490 if ((other != nullptr) && (other->GetScript().length() == 0)) {
491 otherEncodedScript = FindDefaultScriptEncode(other->GetLanguage().c_str(), other->GetRegion().c_str());
493 otherEncodedScript = LocaleUtil::EncodeScriptByLocaleInfo(other);
495 if (current != nullptr && other != nullptr) {
499 if (LocaleUtil::EncodeLocale(other->GetLanguage().c_str(), other->GetScript().c_str(), nullptr) ==
512 uint16_t otherRegionEncode = LocaleUtil::EncodeRegionByLocaleInfo(other);