Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-28 10:00:25

0001 /*=============================================================================
0002     Copyright (c) 2009  Hartmut Kaiser
0003     Copyright (c) 2014  Joel de Guzman
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 #if !defined(BOOST_SPIRIT_X3_BOOL_POLICIES_SEP_29_2009_0710AM)
0009 #define BOOST_SPIRIT_X3_BOOL_POLICIES_SEP_29_2009_0710AM
0010 
0011 #include <boost/spirit/home/x3/string/detail/string_parse.hpp>
0012 #include <boost/spirit/home/x3/support/traits/move_to.hpp>
0013 
0014 namespace boost { namespace spirit { namespace x3
0015 {
0016     ///////////////////////////////////////////////////////////////////////////
0017     //  Default boolean policies
0018     ///////////////////////////////////////////////////////////////////////////
0019     template <typename T = bool>
0020     struct bool_policies
0021     {
0022         template <typename Iterator, typename Attribute, typename CaseCompare>
0023         static bool
0024         parse_true(Iterator& first, Iterator const& last, Attribute& attr_, CaseCompare const& case_compare)
0025         {
0026             if (detail::string_parse("true", first, last, unused, case_compare))
0027             {
0028                 traits::move_to(T(true), attr_);    // result is true
0029                 return true;
0030             }
0031             return false;
0032         }
0033 
0034         template <typename Iterator, typename Attribute, typename CaseCompare>
0035         static bool
0036         parse_false(Iterator& first, Iterator const& last, Attribute& attr_, CaseCompare const& case_compare)
0037         {
0038             if (detail::string_parse("false", first, last, unused, case_compare))
0039             {
0040                 traits::move_to(T(false), attr_);   // result is false
0041                 return true;
0042             }
0043             return false;
0044         }
0045     };
0046 }}}
0047 
0048 #endif