123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- #ifndef BOOST_STRING_COMPARE_HPP
- #define BOOST_STRING_COMPARE_HPP
- #include <boost/algorithm/string/config.hpp>
- #include <locale>
- namespace boost {
- namespace algorithm {
-
-
-
- struct is_equal
- {
-
-
- template< typename T1, typename T2 >
- bool operator()( const T1& Arg1, const T2& Arg2 ) const
- {
- return Arg1==Arg2;
- }
- };
-
-
- struct is_iequal
- {
-
-
- is_iequal( const std::locale& Loc=std::locale() ) :
- m_Loc( Loc ) {}
-
-
- template< typename T1, typename T2 >
- bool operator()( const T1& Arg1, const T2& Arg2 ) const
- {
- #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
- return std::toupper(Arg1)==std::toupper(Arg2);
- #else
- return std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc);
- #endif
- }
- private:
- std::locale m_Loc;
- };
-
-
-
- struct is_less
- {
-
-
- template< typename T1, typename T2 >
- bool operator()( const T1& Arg1, const T2& Arg2 ) const
- {
- return Arg1<Arg2;
- }
- };
-
-
- struct is_iless
- {
-
-
- is_iless( const std::locale& Loc=std::locale() ) :
- m_Loc( Loc ) {}
-
-
- template< typename T1, typename T2 >
- bool operator()( const T1& Arg1, const T2& Arg2 ) const
- {
- #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
- return std::toupper(Arg1)<std::toupper(Arg2);
- #else
- return std::toupper<T1>(Arg1,m_Loc)<std::toupper<T2>(Arg2,m_Loc);
- #endif
- }
- private:
- std::locale m_Loc;
- };
-
-
-
- struct is_not_greater
- {
-
-
- template< typename T1, typename T2 >
- bool operator()( const T1& Arg1, const T2& Arg2 ) const
- {
- return Arg1<=Arg2;
- }
- };
-
-
- struct is_not_igreater
- {
-
-
- is_not_igreater( const std::locale& Loc=std::locale() ) :
- m_Loc( Loc ) {}
-
-
- template< typename T1, typename T2 >
- bool operator()( const T1& Arg1, const T2& Arg2 ) const
- {
- #if defined(BOOST_BORLANDC) && (BOOST_BORLANDC >= 0x560) && (BOOST_BORLANDC <= 0x564) && !defined(_USE_OLD_RW_STL)
- return std::toupper(Arg1)<=std::toupper(Arg2);
- #else
- return std::toupper<T1>(Arg1,m_Loc)<=std::toupper<T2>(Arg2,m_Loc);
- #endif
- }
- private:
- std::locale m_Loc;
- };
- }
-
- using algorithm::is_equal;
- using algorithm::is_iequal;
- using algorithm::is_less;
- using algorithm::is_iless;
- using algorithm::is_not_greater;
- using algorithm::is_not_igreater;
- }
- #endif
|