8 #ifndef BOOST_LOCALE_COLLATOR_HPP_INCLUDED
9 #define BOOST_LOCALE_COLLATOR_HPP_INCLUDED
11 #include <boost/locale/config.hpp>
13 # pragma warning(push)
14 # pragma warning(disable : 4275 4251 4231 4660)
55 template<
typename CharType>
57 public std::collate<CharType>,
120 return do_compare(level,l.data(),l.data()+l.size(),r.data(),r.data()+r.size());
131 return do_hash(level,s.data(),s.data()+s.size());
152 collator(
size_t refs = 0) : std::collate<CharType>(refs)
216 template<
typename CharType,collator_base::level_type default_level = collator_base::
identical>
234 bool operator()(std::basic_string<CharType>
const &left,std::basic_string<CharType>
const &right)
const
236 return std::use_facet<collator<CharType> >(locale_).compare(level_,left,right) < 0;
a facet that holds general information about locale
Definition: info.hpp:27
1st collation level: base letters
Definition: collator.hpp:41
2nd collation level: letters and accents
Definition: collator.hpp:42
virtual int do_compare(char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const
Definition: collator.hpp:164
level_type
Definition: collator.hpp:40
CharType char_type
Definition: collator.hpp:64
identical collation level: include code-point comparison
Definition: collator.hpp:45
long hash(level_type level, char_type const *b, char_type const *e) const
Definition: collator.hpp:106
int compare(level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const
Definition: collator.hpp:77
std::basic_string< CharType > string_type
Definition: collator.hpp:68
a base class that includes collation level flags
Definition: collator.hpp:35
collator(size_t refs=0)
Definition: collator.hpp:152
virtual string_type do_transform(char_type const *b, char_type const *e) const
Definition: collator.hpp:173
long hash(level_type level, string_type const &s) const
Definition: collator.hpp:129
int compare(level_type level, string_type const &l, string_type const &r) const
Definition: collator.hpp:118
string_type transform(level_type level, char_type const *b, char_type const *e) const
Definition: collator.hpp:94
bool operator()(std::basic_string< CharType > const &left, std::basic_string< CharType > const &right) const
Definition: collator.hpp:234
4th collation level: letters, accents, case and punctuation
Definition: collator.hpp:44
Collation facet.
Definition: collator.hpp:56
string_type transform(level_type level, string_type const &s) const
Definition: collator.hpp:142
virtual long do_hash(char_type const *b, char_type const *e) const
Definition: collator.hpp:181
3rd collation level: letters, accents and case
Definition: collator.hpp:43
comparator(std::locale const &l=std::locale(), collator_base::level_type level=default_level)
Definition: collator.hpp:225
This class can be used in STL algorithms and containers for comparison of strings with a level other ...
Definition: collator.hpp:217