1 /*=============================================================================
2 Copyright (c) 2001-2011 Hartmut Kaiser
3 Copyright (c) 2001-2011 Joel de Guzman
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
8 #if !defined(BOOST_SPIRIT_STANDARD_APRIL_26_2006_1106PM)
9 #define BOOST_SPIRIT_STANDARD_APRIL_26_2006_1106PM
16 #include <boost/cstdint.hpp>
18 namespace boost { namespace spirit { namespace char_encoding
20 ///////////////////////////////////////////////////////////////////////////
21 // Test characters for specified conditions (using std functions)
22 ///////////////////////////////////////////////////////////////////////////
25 typedef char char_type;
30 return 0 == (ch & ~0x7f);
37 // we have to watch out for sign extensions
38 return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) ? true : false;
44 return std::isalnum(ch) ? true : false;
50 return std::isalpha(ch) ? true : false;
56 return std::isdigit(ch) ? true : false;
62 return std::isxdigit(ch) ? true : false;
68 return std::iscntrl(ch) ? true : false;
74 return std::isgraph(ch) ? true : false;
80 return std::islower(ch) ? true : false;
86 return std::isprint(ch) ? true : false;
92 return std::ispunct(ch) ? true : false;
98 return std::isspace(ch) ? true : false;
102 isblank BOOST_PREVENT_MACRO_SUBSTITUTION (int ch)
104 return (ch == ' ' || ch == '\t');
110 return std::isupper(ch) ? true : false;
113 ///////////////////////////////////////////////////////////////////////////////
114 // Simple character conversions
115 ///////////////////////////////////////////////////////////////////////////////
120 return std::tolower(ch);
126 return std::toupper(ch);
129 static ::boost::uint32_t