comparison DEPENDENCIES/generic/include/boost/spirit/home/x3/char/char.hpp @ 102:f46d142149f5

Whoops, finish that update
author Chris Cannam
date Mon, 07 Sep 2015 11:13:41 +0100
parents
children
comparison
equal deleted inserted replaced
101:c530137014c0 102:f46d142149f5
1 /*=============================================================================
2 Copyright (c) 2001-2014 Joel de Guzman
3
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)
6 ==============================================================================*/
7 #if !defined(BOOST_SPIRIT_X3_CHAR_APRIL_16_2006_1051AM)
8 #define BOOST_SPIRIT_X3_CHAR_APRIL_16_2006_1051AM
9
10 #if defined(_MSC_VER)
11 #pragma once
12 #endif
13
14 #include <boost/spirit/home/x3/char/any_char.hpp>
15 #include <boost/spirit/home/support/char_encoding/ascii.hpp>
16 #include <boost/spirit/home/support/char_encoding/standard.hpp>
17 #include <boost/spirit/home/support/char_encoding/standard_wide.hpp>
18
19 namespace boost { namespace spirit { namespace x3
20 {
21 namespace standard
22 {
23 typedef any_char<char_encoding::standard> char_type;
24 char_type const char_ = char_type();
25 }
26
27 using standard::char_type;
28 using standard::char_;
29
30 namespace standard_wide
31 {
32 typedef any_char<char_encoding::standard_wide> char_type;
33 char_type const char_ = char_type();
34 }
35
36 namespace ascii
37 {
38 typedef any_char<char_encoding::ascii> char_type;
39 char_type const char_ = char_type();
40 }
41
42 namespace extension
43 {
44 template <>
45 struct as_parser<char>
46 {
47 typedef literal_char<
48 char_encoding::standard, unused_type>
49 type;
50
51 typedef type value_type;
52
53 static type call(char ch)
54 {
55 return type(ch);
56 }
57 };
58
59 template <>
60 struct as_parser<wchar_t>
61 {
62 typedef literal_char<
63 char_encoding::standard_wide, unused_type>
64 type;
65
66 typedef type value_type;
67
68 static type call(wchar_t ch)
69 {
70 return type(ch);
71 }
72 };
73 }
74
75 inline literal_char<char_encoding::standard, unused_type>
76 lit(char ch)
77 {
78 return literal_char<char_encoding::standard, unused_type>(ch);
79 }
80
81 inline literal_char<char_encoding::standard_wide, unused_type>
82 lit(wchar_t ch)
83 {
84 return literal_char<char_encoding::standard_wide, unused_type>(ch);
85 }
86 }}}
87
88 #endif