123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- #ifndef BOOST_LOG_EXPRESSIONS_PREDICATES_BEGINS_WITH_HPP_INCLUDED_
- #define BOOST_LOG_EXPRESSIONS_PREDICATES_BEGINS_WITH_HPP_INCLUDED_
- #include <boost/phoenix/core/actor.hpp>
- #include <boost/log/detail/config.hpp>
- #include <boost/log/detail/embedded_string_type.hpp>
- #include <boost/log/detail/unary_function_terminal.hpp>
- #include <boost/log/detail/attribute_predicate.hpp>
- #include <boost/log/attributes/attribute_name.hpp>
- #include <boost/log/attributes/fallback_policy.hpp>
- #include <boost/log/expressions/attr_fwd.hpp>
- #include <boost/log/expressions/keyword_fwd.hpp>
- #include <boost/log/utility/functional/begins_with.hpp>
- #include <boost/log/detail/header.hpp>
- #ifdef BOOST_HAS_PRAGMA_ONCE
- #pragma once
- #endif
- namespace boost {
- BOOST_LOG_OPEN_NAMESPACE
- namespace expressions {
- #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
- template< typename T, typename SubstringT, typename FallbackPolicyT = fallback_to_none >
- using attribute_begins_with = aux::attribute_predicate< T, SubstringT, begins_with_fun, FallbackPolicyT >;
- #else
- template< typename T, typename SubstringT, typename FallbackPolicyT = fallback_to_none >
- class attribute_begins_with :
- public aux::attribute_predicate< T, SubstringT, begins_with_fun, FallbackPolicyT >
- {
- typedef aux::attribute_predicate< T, SubstringT, begins_with_fun, FallbackPolicyT > base_type;
- public:
-
- attribute_begins_with(attribute_name const& name, SubstringT const& substring) : base_type(name, substring)
- {
- }
-
- template< typename U >
- attribute_begins_with(attribute_name const& name, SubstringT const& substring, U const& arg) : base_type(name, substring, arg)
- {
- }
- };
- #endif
- template< typename T, typename FallbackPolicyT, typename TagT, template< typename > class ActorT, typename SubstringT >
- BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > >
- begins_with(attribute_actor< T, FallbackPolicyT, TagT, ActorT > const& attr, SubstringT const& substring)
- {
- typedef aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type, FallbackPolicyT > > terminal_type;
- ActorT< terminal_type > act = {{ terminal_type(attr.get_name(), substring, attr.get_fallback_policy()) }};
- return act;
- }
- template< typename DescriptorT, template< typename > class ActorT, typename SubstringT >
- BOOST_FORCEINLINE ActorT< aux::unary_function_terminal< attribute_begins_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > >
- begins_with(attribute_keyword< DescriptorT, ActorT > const&, SubstringT const& substring)
- {
- typedef aux::unary_function_terminal< attribute_begins_with< typename DescriptorT::value_type, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type;
- ActorT< terminal_type > act = {{ terminal_type(DescriptorT::get_name(), substring) }};
- return act;
- }
- template< typename T, typename SubstringT >
- BOOST_FORCEINLINE phoenix::actor< aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > >
- begins_with(attribute_name const& name, SubstringT const& substring)
- {
- typedef aux::unary_function_terminal< attribute_begins_with< T, typename boost::log::aux::make_embedded_string_type< SubstringT >::type > > terminal_type;
- phoenix::actor< terminal_type > act = {{ terminal_type(name, substring) }};
- return act;
- }
- }
- BOOST_LOG_CLOSE_NAMESPACE
- }
- #include <boost/log/detail/footer.hpp>
- #endif
|