This source file includes following definitions.
- CompareString16WithCollator
#include "base/i18n/string_compare.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
namespace base {
namespace i18n {
UCollationResult CompareString16WithCollator(const icu::Collator* collator,
const string16& lhs,
const string16& rhs) {
DCHECK(collator);
UErrorCode error = U_ZERO_ERROR;
UCollationResult result = collator->compare(
static_cast<const UChar*>(lhs.c_str()), static_cast<int>(lhs.length()),
static_cast<const UChar*>(rhs.c_str()), static_cast<int>(rhs.length()),
error);
DCHECK(U_SUCCESS(error));
return result;
}
}
}