x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
compare.hpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\algorithm\string\compare.hpp
旋转
特效
属性
历史版本
// Boost string_algo library compare.hpp header file -------------------------// // Copyright Pavol Droba 2002-2006. // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org/ for updates, documentation, and revision history. #ifndef BOOST_STRING_COMPARE_HPP #define BOOST_STRING_COMPARE_HPP #include
#include
/*! \file Defines element comparison predicates. Many algorithms in this library can take an additional argument with a predicate used to compare elements. This makes it possible, for instance, to have case insensitive versions of the algorithms. */ namespace boost { namespace algorithm { // is_equal functor -----------------------------------------------// //! is_equal functor /*! Standard STL equal_to only handle comparison between arguments of the same type. This is a less restrictive version which wraps operator ==. */ struct is_equal { //! Function operator /*! Compare two operands for equality */ template< typename T1, typename T2 > bool operator()( const T1& Arg1, const T2& Arg2 ) const { return Arg1==Arg2; } }; //! case insensitive version of is_equal /*! Case insensitive comparison predicate. Comparison is done using specified locales. */ struct is_iequal { //! Constructor /*! \param Loc locales used for comparison */ is_iequal( const std::locale& Loc=std::locale() ) : m_Loc( Loc ) {} //! Function operator /*! Compare two operands. Case is ignored. */ template< typename T1, typename T2 > bool operator()( const T1& Arg1, const T2& Arg2 ) const { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::toupper(Arg1)==std::toupper(Arg2); #else return std::toupper
(Arg1,m_Loc)==std::toupper
(Arg2,m_Loc); #endif } private: std::locale m_Loc; }; // is_less functor -----------------------------------------------// //! is_less functor /*! Convenient version of standard std::less. Operation is templated, therefore it is not required to specify the exact types upon the construction */ struct is_less { //! Functor operation /*! Compare two operands using > operator */ template< typename T1, typename T2 > bool operator()( const T1& Arg1, const T2& Arg2 ) const { return Arg1
bool operator()( const T1& Arg1, const T2& Arg2 ) const { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::toupper(Arg1)
(Arg1,m_Loc)
(Arg2,m_Loc); #endif } private: std::locale m_Loc; }; // is_not_greater functor -----------------------------------------------// //! is_not_greater functor /*! Convenient version of standard std::not_greater_to. Operation is templated, therefore it is not required to specify the exact types upon the construction */ struct is_not_greater { //! Functor operation /*! Compare two operands using > operator */ template< typename T1, typename T2 > bool operator()( const T1& Arg1, const T2& Arg2 ) const { return Arg1<=Arg2; } }; //! case insensitive version of is_not_greater /*! Case insensitive comparison predicate. Comparison is done using specified locales. */ struct is_not_igreater { //! Constructor /*! \param Loc locales used for comparison */ is_not_igreater( const std::locale& Loc=std::locale() ) : m_Loc( Loc ) {} //! Function operator /*! Compare two operands. Case is ignored. */ template< typename T1, typename T2 > bool operator()( const T1& Arg1, const T2& Arg2 ) const { #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL) return std::toupper(Arg1)<=std::toupper(Arg2); #else return std::toupper
(Arg1,m_Loc)<=std::toupper
(Arg2,m_Loc); #endif } private: std::locale m_Loc; }; } // namespace algorithm // pull names to the boost namespace 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; } // namespace boost #endif // BOOST_STRING_COMPARE_HPP
compare.hpp
网页地址
文件地址
上一页
3/24
下一页
下载
( 6 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.