2013-05-28 16:56:05 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-01-25 18:19:15 +00:00
|
|
|
#include <string>
|
2018-07-20 13:17:16 +00:00
|
|
|
#include <vector>
|
2013-05-29 12:38:20 +00:00
|
|
|
#include <boost/noncopyable.hpp>
|
|
|
|
|
2017-01-25 18:19:15 +00:00
|
|
|
struct UCollator;
|
2016-01-11 21:46:36 +00:00
|
|
|
|
2013-05-29 12:38:20 +00:00
|
|
|
class Collator : private boost::noncopyable
|
2013-05-28 16:56:05 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-04-01 07:20:54 +00:00
|
|
|
explicit Collator(const std::string & locale_);
|
|
|
|
~Collator();
|
2017-01-22 09:07:34 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
int compare(const char * str1, size_t length1, const char * str2, size_t length2) const;
|
2017-01-22 09:07:34 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
const std::string & getLocale() const;
|
2017-01-22 09:07:34 +00:00
|
|
|
|
2018-07-20 13:17:16 +00:00
|
|
|
static std::vector<std::string> getAvailableCollations();
|
|
|
|
|
2013-05-28 16:56:05 +00:00
|
|
|
private:
|
2017-04-01 07:20:54 +00:00
|
|
|
std::string locale;
|
|
|
|
UCollator * collator;
|
2016-01-11 21:46:36 +00:00
|
|
|
};
|