diff options
author | Kevin Smith <git@kismith.co.uk> | 2013-01-12 18:41:34 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2013-01-13 10:36:26 (GMT) |
commit | f3bc816af1b0d61452de973963e453bf3b3f95a2 (patch) | |
tree | e895f8afa3580e6cff6f5ad2017d45bf147a17c2 /3rdParty/Boost/src/boost/spirit/home/support/char_encoding/standard.hpp | |
parent | 188fc285c6555eadd3c9d50ab8a94adcade78d89 (diff) | |
download | swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.zip swift-f3bc816af1b0d61452de973963e453bf3b3f95a2.tar.bz2 |
Adding in the spirit Boost stuff
Change-Id: I4f127ce61667243b64081b0aa309028d5077045f
Diffstat (limited to '3rdParty/Boost/src/boost/spirit/home/support/char_encoding/standard.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/spirit/home/support/char_encoding/standard.hpp | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/spirit/home/support/char_encoding/standard.hpp b/3rdParty/Boost/src/boost/spirit/home/support/char_encoding/standard.hpp new file mode 100644 index 0000000..c32a9e7 --- /dev/null +++ b/3rdParty/Boost/src/boost/spirit/home/support/char_encoding/standard.hpp @@ -0,0 +1,137 @@ +/*============================================================================= + Copyright (c) 2001-2011 Hartmut Kaiser + Copyright (c) 2001-2011 Joel de Guzman + + 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_STANDARD_APRIL_26_2006_1106PM) +#define BOOST_SPIRIT_STANDARD_APRIL_26_2006_1106PM + +#if defined(_MSC_VER) +#pragma once +#endif + +#include <cctype> +#include <boost/cstdint.hpp> + +namespace boost { namespace spirit { namespace char_encoding +{ + /////////////////////////////////////////////////////////////////////////// + // Test characters for specified conditions (using std functions) + /////////////////////////////////////////////////////////////////////////// + struct standard + { + typedef char char_type; + + static bool + isascii_(int ch) + { + return 0 == (ch & ~0x7f); + } + + static bool + ischar(int ch) + { + // uses all 8 bits + // we have to watch out for sign extensions + return (0 == (ch & ~0xff) || ~0 == (ch | 0xff)) ? true : false; + } + + static int + isalnum(int ch) + { + return std::isalnum(ch); + } + + static int + isalpha(int ch) + { + return std::isalpha(ch); + } + + static int + isdigit(int ch) + { + return std::isdigit(ch); + } + + static int + isxdigit(int ch) + { + return std::isxdigit(ch); + } + + static int + iscntrl(int ch) + { + return std::iscntrl(ch); + } + + static int + isgraph(int ch) + { + return std::isgraph(ch); + } + + static int + islower(int ch) + { + return std::islower(ch); + } + + static int + isprint(int ch) + { + return std::isprint(ch); + } + + static int + ispunct(int ch) + { + return std::ispunct(ch); + } + + static int + isspace(int ch) + { + return std::isspace(ch); + } + + static int + isblank BOOST_PREVENT_MACRO_SUBSTITUTION (int ch) + { + return (ch == ' ' || ch == '\t'); + } + + static int + isupper(int ch) + { + return std::isupper(ch); + } + + /////////////////////////////////////////////////////////////////////////////// + // Simple character conversions + /////////////////////////////////////////////////////////////////////////////// + static int + tolower(int ch) + { + return std::tolower(ch); + } + + static int + toupper(int ch) + { + return std::toupper(ch); + } + + static ::boost::uint32_t + toucs4(int ch) + { + return ch; + } + }; +}}} + +#endif + |