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