我正在编写代码,在数据库中创建索引。对于ICU库,我的工作流程是:
ucol_getSortKey获取建立索引的排序密钥。现在我换了个地方。可以促进地区建设排序键,如ICU?还是我应该直接给重症监护室打电话?
发布于 2014-10-05 18:54:56
看起来这就是Boost Locale所知道的collate_impl::do_[basic_]transform()
std::vector<uint8_t> do_basic_transform(level_type level,CharType const *b,CharType const *e) const
{
icu::UnicodeString str=cvt_.icu(b,e);
std::vector<uint8_t> tmp;
tmp.resize(str.length());
icu::Collator *collate = get_collator(level);
int len = collate->getSortKey(str,&tmp[0],tmp.size());
if(len > int(tmp.size())) {
tmp.resize(len);
collate->getSortKey(str,&tmp[0],tmp.size());
}
else
tmp.resize(len);
return tmp;
}
std::basic_string<CharType> do_transform(level_type level,CharType const *b,CharType const *e) const
{
std::vector<uint8_t> tmp = do_basic_transform(level,b,e);
return std::basic_string<CharType>(tmp.begin(),tmp.end());
}为了提高性能,您似乎希望调用do_basic_compare
https://stackoverflow.com/questions/26205528
复制相似问题