1 // Copyright (c) 2001-2011 Hartmut Kaiser
2 // Copyright (c) 2001-2011 Joel de Guzman
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #if !defined(SPIRIT_UPPER_LOWER_CASE_JANUARY_19_2009_1142AM)
8 #define SPIRIT_UPPER_LOWER_CASE_JANUARY_19_2009_1142AM
14 #include <boost/spirit/home/support/common_terminals.hpp>
15 #include <boost/spirit/home/support/modify.hpp>
16 #include <boost/spirit/home/karma/domain.hpp>
17 #include <boost/spirit/home/karma/meta_compiler.hpp>
19 namespace boost { namespace spirit
21 ///////////////////////////////////////////////////////////////////////////
23 ///////////////////////////////////////////////////////////////////////////
24 template <typename CharEncoding>
26 karma::domain, tag::char_code<tag::upper, CharEncoding> > // enables upper
29 template <typename CharEncoding>
31 karma::domain, tag::char_code<tag::lower, CharEncoding> > // enables lower
34 ///////////////////////////////////////////////////////////////////////////
35 template <typename CharEncoding>
36 struct is_modifier_directive<karma::domain
37 , tag::char_code<tag::upper, CharEncoding> >
40 template <typename CharEncoding>
41 struct is_modifier_directive<karma::domain
42 , tag::char_code<tag::lower, CharEncoding> >
45 ///////////////////////////////////////////////////////////////////////////
46 // Don't add tag::upper or tag::lower if there is already one of those in
48 template <typename Current, typename CharEncoding>
49 struct compound_modifier<
51 , tag::char_code<tag::upper, CharEncoding>
53 has_modifier<Current, tag::char_code<tag::lower, CharEncoding> >
61 compound_modifier(Current const& current,
62 tag::char_code<tag::upper, CharEncoding> const&)
66 template <typename Current, typename CharEncoding>
67 struct compound_modifier<
69 , tag::char_code<tag::lower, CharEncoding>
71 has_modifier<Current, tag::char_code<tag::upper, CharEncoding> >
79 compound_modifier(Current const& current,
80 tag::char_code<tag::lower, CharEncoding> const&)