File indexing completed on 2025-02-24 09:54:31
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_LOG_SUPPORT_XPRESSIVE_HPP_INCLUDED_
0016 #define BOOST_LOG_SUPPORT_XPRESSIVE_HPP_INCLUDED_
0017
0018 #include <string>
0019 #include <boost/xpressive/basic_regex.hpp>
0020 #include <boost/xpressive/regex_constants.hpp>
0021 #include <boost/xpressive/regex_algorithms.hpp>
0022 #include <boost/log/detail/config.hpp>
0023 #include <boost/log/utility/functional/matches.hpp>
0024 #include <boost/log/detail/header.hpp>
0025
0026 #ifdef BOOST_HAS_PRAGMA_ONCE
0027 #pragma once
0028 #endif
0029
0030 namespace boost {
0031
0032 BOOST_LOG_OPEN_NAMESPACE
0033
0034 namespace aux {
0035
0036
0037 struct boost_xpressive_expression_tag;
0038
0039
0040 template< typename T >
0041 struct matching_expression_kind< xpressive::basic_regex< T > >
0042 {
0043 typedef boost_xpressive_expression_tag type;
0044 };
0045
0046
0047 template< typename ExpressionT >
0048 struct match_traits< ExpressionT, boost_xpressive_expression_tag >
0049 {
0050 typedef ExpressionT compiled_type;
0051 static compiled_type compile(ExpressionT const& expr) { return expr; }
0052
0053 template< typename StringT, typename T >
0054 static bool matches(StringT const& str, xpressive::basic_regex< T > const& expr, xpressive::regex_constants::match_flag_type flags = xpressive::regex_constants::match_default)
0055 {
0056 return xpressive::regex_match(str, expr, flags);
0057 }
0058
0059 template< typename CharT, typename TraitsT, typename AllocatorT >
0060 static bool matches(std::basic_string< CharT, TraitsT, AllocatorT > const& str, xpressive::basic_regex< const CharT* > const& expr, xpressive::regex_constants::match_flag_type flags = xpressive::regex_constants::match_default)
0061 {
0062 const CharT* p = str.c_str();
0063 return xpressive::regex_match(p, p + str.size(), expr, flags);
0064 }
0065 };
0066
0067 }
0068
0069 BOOST_LOG_CLOSE_NAMESPACE
0070
0071 }
0072
0073 #include <boost/log/detail/footer.hpp>
0074
0075 #endif