Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/spirit/home/karma/auxiliary/eol.hpp @ 16:2665513ce2d3
Add boost headers
author | Chris Cannam |
---|---|
date | Tue, 05 Aug 2014 11:11:38 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
15:663ca0da4350 | 16:2665513ce2d3 |
---|---|
1 // Copyright (c) 2001-2011 Hartmut Kaiser | |
2 // | |
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
5 | |
6 #if !defined(BOOST_SPIRIT_KARMA_EOL_JUL_08_2008_1014AM) | |
7 #define BOOST_SPIRIT_KARMA_EOL_JUL_08_2008_1014AM | |
8 | |
9 #if defined(_MSC_VER) | |
10 #pragma once | |
11 #endif | |
12 | |
13 #include <boost/spirit/home/support/common_terminals.hpp> | |
14 #include <boost/spirit/home/support/info.hpp> | |
15 #include <boost/spirit/home/support/unused.hpp> | |
16 #include <boost/spirit/home/karma/detail/attributes.hpp> | |
17 #include <boost/spirit/home/karma/domain.hpp> | |
18 #include <boost/spirit/home/karma/meta_compiler.hpp> | |
19 #include <boost/spirit/home/karma/delimit_out.hpp> | |
20 #include <boost/spirit/home/karma/detail/generate_to.hpp> | |
21 | |
22 namespace boost { namespace spirit | |
23 { | |
24 /////////////////////////////////////////////////////////////////////////// | |
25 // Enablers | |
26 /////////////////////////////////////////////////////////////////////////// | |
27 template <> | |
28 struct use_terminal<karma::domain, tag::eol> // enables eol | |
29 : mpl::true_ {}; | |
30 | |
31 }} | |
32 | |
33 /////////////////////////////////////////////////////////////////////////////// | |
34 namespace boost { namespace spirit { namespace karma | |
35 { | |
36 #ifndef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS | |
37 using boost::spirit::eol; | |
38 #endif | |
39 using boost::spirit::eol_type; | |
40 | |
41 struct eol_generator : primitive_generator<eol_generator> | |
42 { | |
43 template <typename Context, typename Unused> | |
44 struct attribute | |
45 { | |
46 typedef unused_type type; | |
47 }; | |
48 | |
49 template < | |
50 typename OutputIterator, typename Context, typename Delimiter | |
51 , typename Attribute> | |
52 static bool generate(OutputIterator& sink, Context&, Delimiter const& d | |
53 , Attribute const& /*attr*/) | |
54 { | |
55 return detail::generate_to(sink, '\n') && | |
56 karma::delimit_out(sink, d); // always do post-delimiting | |
57 } | |
58 | |
59 template <typename Context> | |
60 info what(Context const& /*context*/) const | |
61 { | |
62 return info("eol"); | |
63 } | |
64 }; | |
65 | |
66 /////////////////////////////////////////////////////////////////////////// | |
67 // Generator generators: make_xxx function (objects) | |
68 /////////////////////////////////////////////////////////////////////////// | |
69 template <typename Modifiers> | |
70 struct make_primitive<tag::eol, Modifiers> | |
71 { | |
72 typedef eol_generator result_type; | |
73 result_type operator()(unused_type, unused_type) const | |
74 { | |
75 return result_type(); | |
76 } | |
77 }; | |
78 | |
79 }}} | |
80 | |
81 #endif |