comparison DEPENDENCIES/generic/include/boost/log/support/spirit_qi.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 /*
2 * Copyright Andrey Semashev 2007 - 2013.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
6 */
7 /*!
8 * \file support/spirit_qi.hpp
9 * \author Andrey Semashev
10 * \date 19.07.2009
11 *
12 * This header enables Boost.Spirit.Qi support for Boost.Log.
13 */
14
15 #ifndef BOOST_LOG_SUPPORT_SPIRIT_QI_HPP_INCLUDED_
16 #define BOOST_LOG_SUPPORT_SPIRIT_QI_HPP_INCLUDED_
17
18 #include <boost/log/detail/config.hpp>
19 #include <boost/log/utility/functional/matches.hpp>
20 #include <boost/spirit/include/qi_parse.hpp>
21 #include <boost/spirit/include/qi_domain.hpp>
22 #include <boost/spirit/include/support_component.hpp>
23 #include <boost/log/detail/header.hpp>
24
25 #ifdef BOOST_HAS_PRAGMA_ONCE
26 #pragma once
27 #endif
28
29 namespace boost {
30
31 BOOST_LOG_OPEN_NAMESPACE
32
33 namespace aux {
34
35 //! The trait verifies if the type can be converted to a Boost.Spirit.Qi parser
36 template< typename T >
37 struct is_spirit_qi_parser< T, true > :
38 public spirit::traits::is_component< spirit::qi::domain, T >
39 {
40 };
41
42 //! The matching functor implementation
43 template< >
44 struct matches_fun_impl< boost_spirit_qi_expression_tag >
45 {
46 template< typename StringT, typename ParserT >
47 static bool matches(
48 StringT const& str,
49 ParserT const& expr)
50 {
51 typedef typename StringT::const_iterator const_iterator;
52 const_iterator it = str.begin(), end = str.end();
53 return (spirit::qi::parse(it, end, expr) && it == end);
54 }
55 };
56
57 } // namespace aux
58
59 BOOST_LOG_CLOSE_NAMESPACE // namespace log
60
61 } // namespace boost
62
63 #include <boost/log/detail/footer.hpp>
64
65 #endif // BOOST_LOG_SUPPORT_SPIRIT_QI_HPP_INCLUDED_