CppCMS
|
This class can be used in STL algorithms and containers for comparison of strings with a level other than primary. More...
#include <booster/booster/locale/collator.h>
Public Member Functions | |
comparator (std::locale const &l=std::locale(), collator_base::level_type level=default_level) | |
bool | operator() (std::basic_string< CharType > const &left, std::basic_string< CharType > const &right) const |
This class can be used in STL algorithms and containers for comparison of strings with a level other than primary.
For example:
std::map<std::string,std::string,comparator<char,collator_base::secondary> > data;
Would create a map the keys of which are sorted using secondary collation level
booster::locale::comparator< CharType, default_level >::comparator | ( | std::locale const & | l = std::locale() , |
collator_base::level_type | level = default_level |
||
) | [inline] |
Create a comparator class for locale l and with collation leval level
bool booster::locale::comparator< CharType, default_level >::operator() | ( | std::basic_string< CharType > const & | left, |
std::basic_string< CharType > const & | right | ||
) | const [inline] |
Compare two strings -- equivalent to return left < right according to collation rules