ClickHouse/dbms/include/DB/Common/Collator.h

32 lines
535 B
C++
Raw Normal View History

2013-05-28 16:56:05 +00:00
#pragma once
#include <string>
#include <boost/noncopyable.hpp>
struct UCollator;
namespace DB
{
namespace ErrorCodes
{
extern const int UNSUPPORTED_COLLATION_LOCALE;
extern const int COLLATION_COMPARISON_FAILED;
}
}
class Collator : private boost::noncopyable
2013-05-28 16:56:05 +00:00
{
public:
explicit Collator(const std::string & locale_);
~Collator();
2017-01-22 09:07:34 +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
const std::string & getLocale() const;
2017-01-22 09:07:34 +00:00
2013-05-28 16:56:05 +00:00
private:
std::string locale;
UCollator * collator;
};