blob: c32a9e73d8a66f598f8bb9a2135a0dfbda7e0efd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
|