#include <boost/locale/collator.hpp>
Public Types | |
typedef CharType | char_type |
typedef std::basic_string < CharType > | string_type |
Public Member Functions | |
int | compare (level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const |
string_type | transform (level_type level, char_type const *b, char_type const *e) const |
long | hash (level_type level, char_type const *b, char_type const *e) const |
int | compare (level_type level, string_type const &l, string_type const &r) const |
long | hash (level_type level, string_type const &s) const |
string_type | transform (level_type level, string_type const &s) const |
Static Public Member Functions | |
static collator< CharType > * | create (info const &inf) |
Protected Member Functions | |
collator (size_t refs=0) | |
virtual int | do_compare (char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const |
virtual string_type | do_transform (char_type const *b, char_type const *e) const |
virtual long | do_hash (char_type const *b, char_type const *e) const |
virtual int | do_compare (level_type level, char_type const *b1, char_type const *e1, char_type const *b2, char_type const *e2) const =0 |
virtual string_type | do_transform (level_type level, char_type const *b, char_type const *e) const =0 |
virtual long | do_hash (level_type level, char_type const *b, char_type const *e) const =0 |
It reimplements standard C++ stc::collate allowing usage of std::locale class for direct string comparison
typedef CharType boost::locale::collator< CharType >::char_type |
Type of underlying character
typedef std::basic_string<CharType> boost::locale::collator< CharType >::string_type |
Type of string used with this facet
boost::locale::collator< CharType >::collator | ( | size_t | refs = 0 |
) | [inline, protected] |
constructor of the collator object
int boost::locale::collator< CharType >::compare | ( | level_type | level, | |
char_type const * | b1, | |||
char_type const * | e1, | |||
char_type const * | b2, | |||
char_type const * | e2 | |||
) | const [inline] |
Compare two strings in rage [b1,e1), [b2,e2) according using a collation level level. Calls do_compare
string_type boost::locale::collator< CharType >::transform | ( | level_type | level, | |
char_type const * | b, | |||
char_type const * | e | |||
) | const [inline] |
Create a binary string that can be compared to other in order to get collation order. The string is created for text in range [b,e). It is useful for collation of multiple strings for text. Calls do_transform
long boost::locale::collator< CharType >::hash | ( | level_type | level, | |
char_type const * | b, | |||
char_type const * | e | |||
) | const [inline] |
Calculate a hash of a text in range [b,e). The value can be used for collation sensitive string comparison. Calls do_hash
int boost::locale::collator< CharType >::compare | ( | level_type | level, | |
string_type const & | l, | |||
string_type const & | r | |||
) | const [inline] |
Compare two strings l and r using collation level level
long boost::locale::collator< CharType >::hash | ( | level_type | level, | |
string_type const & | s | |||
) | const [inline] |
Calculate a hash that can be used for collation sensitive string comparison of a string s
string_type boost::locale::collator< CharType >::transform | ( | level_type | level, | |
string_type const & | s | |||
) | const [inline] |
Create a binary string from string s, that can be compared to other, useful for collation of multiple strings.
static collator<CharType>* boost::locale::collator< CharType >::create | ( | info const & | inf | ) | [static] |
virtual int boost::locale::collator< CharType >::do_compare | ( | char_type const * | b1, | |
char_type const * | e1, | |||
char_type const * | b2, | |||
char_type const * | e2 | |||
) | const [inline, protected, virtual] |
This function is used to override default collation function that does not take in account collation level. Uses primary level
virtual string_type boost::locale::collator< CharType >::do_transform | ( | char_type const * | b, | |
char_type const * | e | |||
) | const [inline, protected, virtual] |
This function is used to override default collation function that does not take in account collation level. Uses primary level
virtual long boost::locale::collator< CharType >::do_hash | ( | char_type const * | b, | |
char_type const * | e | |||
) | const [inline, protected, virtual] |
This function is used to override default collation function that does not take in account collation level. Uses primary level
virtual int boost::locale::collator< CharType >::do_compare | ( | level_type | level, | |
char_type const * | b1, | |||
char_type const * | e1, | |||
char_type const * | b2, | |||
char_type const * | e2 | |||
) | const [protected, pure virtual] |
Actual function that performs comparison between the strings. For details see compare member function. Can be overridden.
virtual string_type boost::locale::collator< CharType >::do_transform | ( | level_type | level, | |
char_type const * | b, | |||
char_type const * | e | |||
) | const [protected, pure virtual] |
Actual function that performs transformation. For details see transform member function. Can be overridden.
virtual long boost::locale::collator< CharType >::do_hash | ( | level_type | level, | |
char_type const * | b, | |||
char_type const * | e | |||
) | const [protected, pure virtual] |
Actual function that calculates hash. For details see hash member function. Can be overridden.