File indexing completed on 2025-01-18 09:39:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_LOG_EXPRESSIONS_PREDICATES_MATCHES_HPP_INCLUDED_
0016 #define BOOST_LOG_EXPRESSIONS_PREDICATES_MATCHES_HPP_INCLUDED_
0017
0018 #include <boost/phoenix/core/actor.hpp>
0019 #include <boost/log/detail/config.hpp>
0020 #include <boost/log/detail/unary_function_terminal.hpp>
0021 #include <boost/log/detail/attribute_predicate.hpp>
0022 #include <boost/log/expressions/attr_fwd.hpp>
0023 #include <boost/log/expressions/keyword_fwd.hpp>
0024 #include <boost/log/attributes/attribute_name.hpp>
0025 #include <boost/log/attributes/fallback_policy.hpp>
0026 #include <boost/log/utility/functional/matches.hpp>
0027 #include <boost/log/detail/header.hpp>
0028
0029 #ifdef BOOST_HAS_PRAGMA_ONCE
0030 #pragma once
0031 #endif
0032
0033 namespace boost {
0034
0035 BOOST_LOG_OPEN_NAMESPACE
0036
0037 namespace expressions {
0038
0039
0040
0041
0042 template< typename T, typename RegexT, typename FallbackPolicyT = fallback_to_none >
0043 class attribute_matches :
0044 public aux::attribute_predicate< T, typename boost::log::aux::match_traits< RegexT >::compiled_type, matches_fun, FallbackPolicyT >
0045 {
0046 typedef aux::attribute_predicate< T, typename boost::log::aux::match_traits< RegexT >::compiled_type, matches_fun, FallbackPolicyT > base_type;
0047
0048 public:
0049
0050
0051
0052
0053
0054
0055 attribute_matches(attribute_name const& name, RegexT const& rex) : base_type(name, boost::log::aux::match_traits< RegexT >::compile(rex))
0056 {
0057 }
0058
0059
0060
0061
0062
0063
0064
0065
0066 template< typename U >
0067 attribute_matches(attribute_name const& name, RegexT const& rex, U const& arg) : base_type(name, boost::log::aux::match_traits< RegexT >::compile(rex), arg)
0068 {
0069 }
0070 };
0071
0072 #if defined(BOOST_MSVC) && BOOST_MSVC == 1925
0073
0074
0075 #define BOOST_LOG_AUX_FORCEINLINE_MSVC_BUG982738 inline BOOST_NOINLINE
0076 #else
0077 #define BOOST_LOG_AUX_FORCEINLINE_MSVC_BUG982738 BOOST_FORCEINLINE
0078 #endif
0079
0080
0081
0082
0083
0084 template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename RegexT >
0085 BOOST_LOG_AUX_FORCEINLINE_MSVC_BUG982738 ActorT< aux::unary_function_terminal< attribute_matches< T, RegexT, FallbackPolicyT > > >
0086 matches(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, RegexT const& rex)
0087 {
0088 typedef aux::unary_function_terminal< attribute_matches< T, RegexT, FallbackPolicyT > > terminal_type;
0089 ActorT< terminal_type > act = {{ terminal_type(attr.get_name(), rex, attr.get_fallback_policy()) }};
0090 return act;
0091 }
0092
0093
0094
0095
0096
0097 template< typename DescriptorT, template< typename > class ActorT, typename RegexT >
0098 BOOST_LOG_AUX_FORCEINLINE_MSVC_BUG982738 ActorT< aux::unary_function_terminal< attribute_matches< typename DescriptorT::value_type, RegexT > > >
0099 matches(attribute_keyword< DescriptorT, ActorT > const&, RegexT const& rex)
0100 {
0101 typedef aux::unary_function_terminal< attribute_matches< typename DescriptorT::value_type, RegexT > > terminal_type;
0102 ActorT< terminal_type > act = {{ terminal_type(DescriptorT::get_name(), rex) }};
0103 return act;
0104 }
0105
0106
0107
0108
0109
0110 template< typename T, typename RegexT >
0111 BOOST_LOG_AUX_FORCEINLINE_MSVC_BUG982738 phoenix::actor< aux::unary_function_terminal< attribute_matches< T, RegexT > > >
0112 matches(attribute_name const& name, RegexT const& rex)
0113 {
0114 typedef aux::unary_function_terminal< attribute_matches< T, RegexT > > terminal_type;
0115 phoenix::actor< terminal_type > act = {{ terminal_type(name, rex) }};
0116 return act;
0117 }
0118
0119 #undef BOOST_LOG_AUX_FORCEINLINE_MSVC_BUG982738
0120
0121 }
0122
0123 BOOST_LOG_CLOSE_NAMESPACE
0124
0125 }
0126
0127 #include <boost/log/detail/footer.hpp>
0128
0129 #endif