Lines Matching refs:collator
376 // Returns an ICU collator -- i.e. string comparator -- appropriate for the
378 icu::Collator* GetCollatorForLocale(const std::string& locale);
380 // Returns the ICU sort key corresponding to |str| for the given |collator|.
384 const std::string GetSortKey(const icu::Collator& collator,
403 std::map<std::string, icu::Collator*> collators_;
466 const icu::Collator* collator = GetCollatorForLocale(locale);
479 std::string sort_key = GetSortKey(*collator,
495 icu::Collator* collator = GetCollatorForLocale(locale);
502 std::string sort_key = GetSortKey(*collator,
518 icu::Collator* CountryNames::GetCollatorForLocale(const std::string& locale) {
522 icu::Collator* collator(icu::Collator::createInstance(icu_locale, ignored));
526 collator->setAttribute(UCOL_STRENGTH, UCOL_SECONDARY, ignored);
528 collator->setAttribute(UCOL_ALTERNATE_HANDLING, UCOL_SHIFTED, ignored);
530 collators_.insert(std::make_pair(locale, collator));
536 const std::string CountryNames::GetSortKey(const icu::Collator& collator,
543 int32_t expected_size = collator.getSortKey(str, buffer->get(), *buffer_size);
550 expected_size = collator.getSortKey(str, buffer->get(), *buffer_size);