Lines Matching refs:current
44 int8_t LocaleMatcher::IsMoreSuitable(const LocaleInfo *current, const LocaleInfo *other, const Loca… in IsMoreSuitable() argument
48 if (current != nullptr && other == nullptr) { in IsMoreSuitable()
52 if (current == nullptr && other != nullptr) { in IsMoreSuitable()
58 if (current == nullptr && other == nullptr) { in IsMoreSuitable()
61 bool isLangEqual = CompareLanguage(current, other); in IsMoreSuitable()
64 bool result = CompareRegionWhenLangIsNotEqual(current, other, request); in IsMoreSuitable()
68 LocaleUtil::EncodeRegionByLocaleInfo(current); in IsMoreSuitable()
73 return CompareLanguageIgnoreOldNewCode(current, other, request); in IsMoreSuitable()
83 int8_t isRegionEqual = CompareRegion(current, other, request); in IsMoreSuitable()
85 return CompareLanguageIgnoreOldNewCode(current, other, request); in IsMoreSuitable()
90 bool LocaleMatcher::CompareLanguage(const LocaleInfo *current, const LocaleInfo *other) in CompareLanguage() argument
92 uint16_t currentEncodedLanguage = LocaleUtil::EncodeLanguageByLocaleInfo(current); in CompareLanguage()
118 bool LocaleMatcher::CompareRegionWhenLangIsNotEqual(const LocaleInfo *current, const LocaleInfo *ot… in CompareRegionWhenLangIsNotEqual() argument
121 int8_t qaagResult = CompareRegionWhenQaag(current, other, request); in CompareRegionWhenLangIsNotEqual()
129 if (current != nullptr) { in CompareRegionWhenLangIsNotEqual()
130 return (current->GetRegion().length() == 0) || in CompareRegionWhenLangIsNotEqual()
131 … ((LocaleUtil::EncodeRegion(current->GetRegion().c_str())) == LocaleUtil::EncodeRegion("US")); in CompareRegionWhenLangIsNotEqual()
137 if (current != nullptr) { in CompareRegionWhenLangIsNotEqual()
138 return IsSimilarToUsEnglish(current); in CompareRegionWhenLangIsNotEqual()
144 return current != nullptr; in CompareRegionWhenLangIsNotEqual()
147 int8_t LocaleMatcher::CompareRegionWhenQaag(const LocaleInfo *current, const LocaleInfo *other, in CompareRegionWhenQaag() argument
152 … if ((current != nullptr) && (LocaleUtil::EncodeLocale(current->GetLanguage().c_str(), nullptr, in CompareRegionWhenQaag()
153 current->GetRegion().c_str()) == LocaleMatcher::EN_GB_ENCODE)) { in CompareRegionWhenQaag()
232 int8_t LocaleMatcher::CompareRegion(const LocaleInfo *current, const LocaleInfo *other, const Local… in CompareRegion() argument
234 uint16_t currentEncodedRegion = LocaleUtil::EncodeRegionByLocaleInfo(current); in CompareRegion()
237 … return CompareWhenRegionIsNull(currentEncodedRegion, otherEncodedRegion, current, other, request); in CompareRegion()
244 (current == nullptr) ? nullptr : current->GetRegion().c_str()); in CompareRegion()
261 result = CompareDefaultRegion(current, other, request); in CompareRegion()
273 return AlphabeticallyCompare(current, currentEncodedLocale, other, otherEncodedLocale); in CompareRegion()
277 const LocaleInfo *current, const LocaleInfo *other, const LocaleInfo *request) in CompareWhenRegionIsNull() argument
279 if (current == nullptr || current->GetRegion().length() == 0) { in CompareWhenRegionIsNull()
285 int8_t qaagResult = CompareRegionWhenQaag(current, other, request); in CompareWhenRegionIsNull()
302 (current == nullptr) ? nullptr : current->GetRegion().c_str()); in CompareWhenRegionIsNull()
305 return AlphabeticallyCompare(current, currentEncodedLocale, other, otherEncodedLocale); in CompareWhenRegionIsNull()
332 int8_t LocaleMatcher::AlphabeticallyCompare(const LocaleInfo *current, uint64_t currentEncodedLocal… in AlphabeticallyCompare() argument
338 if (current == nullptr || current->GetRegion().length() == 0) { in AlphabeticallyCompare()
345 char currentFirstChar = (current->GetRegion())[0]; in AlphabeticallyCompare()
415 int8_t LocaleMatcher::CompareDefaultRegion(const LocaleInfo *current, const LocaleInfo *other, in CompareDefaultRegion() argument
418 int8_t qaagResult = CompareRegionWhenQaag(current, other, request); in CompareDefaultRegion()
424 (current == nullptr) ? nullptr : current->GetRegion().c_str()); in CompareDefaultRegion()
453 int8_t LocaleMatcher::CompareLanguageIgnoreOldNewCode(const LocaleInfo *current, const LocaleInfo *… in CompareLanguageIgnoreOldNewCode() argument
456 uint16_t currentLanguageEncode = LocaleUtil::EncodeLanguageByLocaleInfo(current); in CompareLanguageIgnoreOldNewCode()
468 bool LocaleMatcher::Match(const LocaleInfo *current, const LocaleInfo *other) in Match() argument
470 if (current == nullptr || other == nullptr) { in Match()
474 bool isLanguageEqual = CompareLanguage(current, other); in Match()
478 return CompareScript(current, other); in Match()
481 bool LocaleMatcher::CompareScript(const LocaleInfo *current, const LocaleInfo *other) in CompareScript() argument
485 if ((current != nullptr) && (current->GetScript().length() == 0)) { in CompareScript()
486 …currentEncodedScript = FindDefaultScriptEncode(current->GetLanguage().c_str(), current->GetRegion(… in CompareScript()
488 currentEncodedScript = LocaleUtil::EncodeScriptByLocaleInfo(current); in CompareScript()
495 if (current != nullptr && other != nullptr) { in CompareScript()
497 …if (LocaleUtil::EncodeLocale(current->GetLanguage().c_str(), current->GetScript().c_str(), nullptr… in CompareScript()
511 uint16_t currentRegionEncode = LocaleUtil::EncodeRegionByLocaleInfo(current); in CompareScript()