Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:27

0001 /*
0002  *          Copyright Andrey Semashev 2007 - 2015.
0003  * Distributed under the Boost Software License, Version 1.0.
0004  *    (See accompanying file LICENSE_1_0.txt or copy at
0005  *          http://www.boost.org/LICENSE_1_0.txt)
0006  */
0007 /*!
0008  * \file   matches.hpp
0009  * \author Andrey Semashev
0010  * \date   30.03.2008
0011  *
0012  * This header contains a predicate for checking if the provided string matches a regular expression.
0013  */
0014 
0015 #ifndef BOOST_LOG_UTILITY_FUNCTIONAL_MATCHES_HPP_INCLUDED_
0016 #define BOOST_LOG_UTILITY_FUNCTIONAL_MATCHES_HPP_INCLUDED_
0017 
0018 #include <boost/log/detail/config.hpp>
0019 #include <boost/log/detail/header.hpp>
0020 
0021 #ifdef BOOST_HAS_PRAGMA_ONCE
0022 #pragma once
0023 #endif
0024 
0025 namespace boost {
0026 
0027 BOOST_LOG_OPEN_NAMESPACE
0028 
0029 namespace aux {
0030 
0031 //! The metafunction detects the matching expression kind and returns a tag that is used to specialize \c match_traits
0032 template< typename ExpressionT, typename = void >
0033 struct matching_expression_kind;
0034 
0035 //! The matching function implementation
0036 template< typename ExpressionT, typename TagT = typename matching_expression_kind< ExpressionT >::type >
0037 struct match_traits;
0038 
0039 } // namespace aux
0040 
0041 //! The regex matching functor
0042 struct matches_fun
0043 {
0044     typedef bool result_type;
0045 
0046     template< typename StringT, typename ExpressionT >
0047     bool operator() (StringT const& str, ExpressionT const& expr) const
0048     {
0049         typedef aux::match_traits< ExpressionT > impl;
0050         return impl::matches(str, expr);
0051     }
0052     template< typename StringT, typename ExpressionT, typename ArgT >
0053     bool operator() (StringT const& str, ExpressionT const& expr, ArgT const& arg) const
0054     {
0055         typedef aux::match_traits< ExpressionT > impl;
0056         return impl::matches(str, expr, arg);
0057     }
0058 };
0059 
0060 BOOST_LOG_CLOSE_NAMESPACE // namespace log
0061 
0062 } // namespace boost
0063 
0064 #include <boost/log/detail/footer.hpp>
0065 
0066 #endif // BOOST_LOG_UTILITY_FUNCTIONAL_MATCHES_HPP_INCLUDED_