123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- #ifndef BOOST_LOG_SUPPORT_XPRESSIVE_HPP_INCLUDED_
- #define BOOST_LOG_SUPPORT_XPRESSIVE_HPP_INCLUDED_
- #include <string>
- #include <boost/xpressive/basic_regex.hpp>
- #include <boost/xpressive/regex_constants.hpp>
- #include <boost/xpressive/regex_algorithms.hpp>
- #include <boost/log/detail/config.hpp>
- #include <boost/log/utility/functional/matches.hpp>
- #include <boost/log/detail/header.hpp>
- #ifdef BOOST_HAS_PRAGMA_ONCE
- #pragma once
- #endif
- namespace boost {
- BOOST_LOG_OPEN_NAMESPACE
- namespace aux {
- struct boost_xpressive_expression_tag;
- template< typename T >
- struct matching_expression_kind< xpressive::basic_regex< T > >
- {
- typedef boost_xpressive_expression_tag type;
- };
- template< typename ExpressionT >
- struct match_traits< ExpressionT, boost_xpressive_expression_tag >
- {
- typedef ExpressionT compiled_type;
- static compiled_type compile(ExpressionT const& expr) { return expr; }
- template< typename StringT, typename T >
- static bool matches(StringT const& str, xpressive::basic_regex< T > const& expr, xpressive::regex_constants::match_flag_type flags = xpressive::regex_constants::match_default)
- {
- return xpressive::regex_match(str, expr, flags);
- }
- template< typename CharT, typename TraitsT, typename AllocatorT >
- 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)
- {
- const CharT* p = str.c_str();
- return xpressive::regex_match(p, p + str.size(), expr, flags);
- }
- };
- }
- BOOST_LOG_CLOSE_NAMESPACE
- }
- #include <boost/log/detail/footer.hpp>
- #endif
|