2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
9 * \author Andrey Semashev
12 * This header contains a predicate for checking if the provided string matches a regular expression.
15 #ifndef BOOST_LOG_UTILITY_FUNCTIONAL_MATCHES_HPP_INCLUDED_
16 #define BOOST_LOG_UTILITY_FUNCTIONAL_MATCHES_HPP_INCLUDED_
18 #include <boost/log/detail/config.hpp>
19 #include <boost/log/detail/header.hpp>
21 #ifdef BOOST_HAS_PRAGMA_ONCE
27 BOOST_LOG_OPEN_NAMESPACE
31 //! The metafunction detects the matching expression kind and returns a tag that is used to specialize \c match_traits
32 template< typename ExpressionT, typename = void >
33 struct matching_expression_kind;
35 //! The matching function implementation
36 template< typename ExpressionT, typename TagT = typename matching_expression_kind< ExpressionT >::type >
41 //! The regex matching functor
44 typedef bool result_type;
46 template< typename StringT, typename ExpressionT >
47 bool operator() (StringT const& str, ExpressionT const& expr) const
49 typedef aux::match_traits< ExpressionT > impl;
50 return impl::matches(str, expr);
52 template< typename StringT, typename ExpressionT, typename ArgT >
53 bool operator() (StringT const& str, ExpressionT const& expr, ArgT const& arg) const
55 typedef aux::match_traits< ExpressionT > impl;
56 return impl::matches(str, expr, arg);
60 BOOST_LOG_CLOSE_NAMESPACE // namespace log
64 #include <boost/log/detail/footer.hpp>
66 #endif // BOOST_LOG_UTILITY_FUNCTIONAL_MATCHES_HPP_INCLUDED_