// Copyright (c) 2001-2010 Hartmut Kaiser // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #if !defined(BOOST_SPIRIT_KARMA_EOL_JUL_08_2008_1014AM) #define BOOST_SPIRIT_KARMA_EOL_JUL_08_2008_1014AM #if defined(_MSC_VER) #pragma once #endif #include #include #include #include #include #include #include #include namespace boost { namespace spirit { /////////////////////////////////////////////////////////////////////////// // Enablers /////////////////////////////////////////////////////////////////////////// template <> struct use_terminal // enables eol : mpl::true_ {}; }} /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { namespace karma { using boost::spirit::eol; using boost::spirit::eol_type; struct eol_generator : primitive_generator { template struct attribute { typedef unused_type type; }; template < typename OutputIterator, typename Context, typename Delimiter , typename Attribute> static bool generate(OutputIterator& sink, Context&, Delimiter const& d , Attribute const& /*attr*/) { return detail::generate_to(sink, '\n') && karma::delimit_out(sink, d); // always do post-delimiting } template info what(Context const& /*context*/) const { return info("eol"); } }; /////////////////////////////////////////////////////////////////////////// // Generator generators: make_xxx function (objects) /////////////////////////////////////////////////////////////////////////// template struct make_primitive { typedef eol_generator result_type; result_type operator()(unused_type, unused_type) const { return result_type(); } }; }}} #endif