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_BEGINS_WITH_HPP_INCLUDED_
0016 #define BOOST_LOG_EXPRESSIONS_PREDICATES_BEGINS_WITH_HPP_INCLUDED_
0017
0018 #include <boost/phoenix/core/actor.hpp>
0019 #include <boost/log/detail/config.hpp>
0020 #include <boost/log/detail/embedded_string_type.hpp>
0021 #include <boost/log/detail/unary_function_terminal.hpp>
0022 #include <boost/log/detail/attribute_predicate.hpp>
0023 #include <boost/log/attributes/attribute_name.hpp>
0024 #include <boost/log/attributes/fallback_policy.hpp>
0025 #include <boost/log/expressions/attr_fwd.hpp>
0026 #include <boost/log/expressions/keyword_fwd.hpp>
0027 #include <boost/log/utility/functional/begins_with.hpp>
0028 #include <boost/log/detail/header.hpp>
0029
0030 #ifdef BOOST_HAS_PRAGMA_ONCE
0031 #pragma once
0032 #endif
0033
0034 namespace boost {
0035
0036 BOOST_LOG_OPEN_NAMESPACE
0037
0038 namespace expressions {
0039
0040
0041
0042
0043 #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
0044
0045 template< typename T, typename SubstringT, typename FallbackPolicyT = fallback_to_none >
0046 using attribute_begins_with = aux::attribute_predicate< T, SubstringT, begins_with_fun, FallbackPolicyT >;
0047
0048 #else
0049
0050 template< typename T, typename SubstringT, typename FallbackPolicyT = fallback_to_none >
0051 class attribute_begins_with :
0052 public aux::attribute_predicate< T, SubstringT, begins_with_fun, FallbackPolicyT >
0053 {
0054 typedef aux::attribute_predicate< T, SubstringT, begins_with_fun, FallbackPolicyT > base_type;
0055
0056 public:
0057
0058
0059
0060
0061
0062
0063 attribute_begins_with(attribute_name const& name, SubstringT const& substring) : base_type(name, substring)
0064 {
0065 }
0066
0067
0068
0069
0070
0071
0072
0073
0074 template< typename U >
0075 attribute_begins_with(attribute_name const& name, SubstringT const& substring, U const& arg) : base_type(name, substring, arg)
0076 {
0077 }
0078 };
0079
0080 #endif
0081
0082
0083
0084
0085
0086 template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename SubstringT >
0087 BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > >
0088 begins_with(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, SubstringT const& substring)
0089 {
0090 typedef aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > terminal_type;
0091 ActorT< terminal_type > act = {{ terminal_type(attr.get_name(), substring, attr.get_fallback_policy()) }};
0092 return act;
0093 }
0094
0095
0096
0097
0098
0099 template< typename DescriptorT, template< typename > class ActorT, typename SubstringT >
0100 BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > >
0101 begins_with(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& substring)
0102 {
0103 typedef aux::unary_function_terminal< attribute_begins_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type;
0104 ActorT< terminal_type > act = {{ terminal_type(DescriptorT::get_name(), substring) }};
0105 return act;
0106 }
0107
0108
0109
0110
0111
0112 template< typename T, typename SubstringT >
0113 BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > >
0114 begins_with(attribute_name const& name, SubstringT const& substring)
0115 {
0116 typedef aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type;
0117 phoenix::actor< terminal_type > act = {{ terminal_type(name, substring) }};
0118 return act;
0119 }
0120
0121 }
0122
0123 BOOST_LOG_CLOSE_NAMESPACE
0124
0125 }
0126
0127 #include <boost/log/detail/footer.hpp>
0128
0129 #endif