|
1 |
| -// Copyright John W. Wilkinson 2007 - 2013 |
| 1 | +// Copyright John W. Wilkinson 2007 - 2009. |
2 | 2 | // Distributed under the MIT License, see accompanying file LICENSE.txt
|
3 | 3 |
|
4 |
| -// json spirit version 4.06 |
| 4 | +// json spirit version 4.03 |
5 | 5 |
|
6 | 6 | #include "json_spirit_reader.h"
|
7 | 7 | #include "json_spirit_reader_template.h"
|
8 | 8 |
|
9 | 9 | using namespace json_spirit;
|
10 | 10 |
|
11 |
| -#ifdef JSON_SPIRIT_VALUE_ENABLED |
12 |
| - bool json_spirit::read( const std::string& s, Value& value ) |
13 |
| - { |
14 |
| - return read_string( s, value ); |
15 |
| - } |
16 |
| - |
17 |
| - void json_spirit::read_or_throw( const std::string& s, Value& value ) |
18 |
| - { |
19 |
| - read_string_or_throw( s, value ); |
20 |
| - } |
21 |
| - |
22 |
| - bool json_spirit::read( std::istream& is, Value& value ) |
23 |
| - { |
24 |
| - return read_stream( is, value ); |
25 |
| - } |
26 |
| - |
27 |
| - void json_spirit::read_or_throw( std::istream& is, Value& value ) |
28 |
| - { |
29 |
| - read_stream_or_throw( is, value ); |
30 |
| - } |
31 |
| - |
32 |
| - bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) |
33 |
| - { |
34 |
| - return read_range( begin, end, value ); |
35 |
| - } |
36 |
| - |
37 |
| - void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) |
38 |
| - { |
39 |
| - begin = read_range_or_throw( begin, end, value ); |
40 |
| - } |
41 |
| -#endif |
| 11 | +bool json_spirit::read( const std::string& s, Value& value ) |
| 12 | +{ |
| 13 | + return read_string( s, value ); |
| 14 | +} |
| 15 | + |
| 16 | +void json_spirit::read_or_throw( const std::string& s, Value& value ) |
| 17 | +{ |
| 18 | + read_string_or_throw( s, value ); |
| 19 | +} |
| 20 | + |
| 21 | +bool json_spirit::read( std::istream& is, Value& value ) |
| 22 | +{ |
| 23 | + return read_stream( is, value ); |
| 24 | +} |
| 25 | + |
| 26 | +void json_spirit::read_or_throw( std::istream& is, Value& value ) |
| 27 | +{ |
| 28 | + read_stream_or_throw( is, value ); |
| 29 | +} |
| 30 | + |
| 31 | +bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) |
| 32 | +{ |
| 33 | + return read_range( begin, end, value ); |
| 34 | +} |
| 35 | + |
| 36 | +void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ) |
| 37 | +{ |
| 38 | + begin = read_range_or_throw( begin, end, value ); |
| 39 | +} |
| 40 | + |
| 41 | +#ifndef BOOST_NO_STD_WSTRING |
| 42 | + |
| 43 | +bool json_spirit::read( const std::wstring& s, wValue& value ) |
| 44 | +{ |
| 45 | + return read_string( s, value ); |
| 46 | +} |
| 47 | + |
| 48 | +void json_spirit::read_or_throw( const std::wstring& s, wValue& value ) |
| 49 | +{ |
| 50 | + read_string_or_throw( s, value ); |
| 51 | +} |
| 52 | + |
| 53 | +bool json_spirit::read( std::wistream& is, wValue& value ) |
| 54 | +{ |
| 55 | + return read_stream( is, value ); |
| 56 | +} |
| 57 | + |
| 58 | +void json_spirit::read_or_throw( std::wistream& is, wValue& value ) |
| 59 | +{ |
| 60 | + read_stream_or_throw( is, value ); |
| 61 | +} |
| 62 | + |
| 63 | +bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) |
| 64 | +{ |
| 65 | + return read_range( begin, end, value ); |
| 66 | +} |
| 67 | + |
| 68 | +void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) |
| 69 | +{ |
| 70 | + begin = read_range_or_throw( begin, end, value ); |
| 71 | +} |
42 | 72 |
|
43 |
| -#if defined( JSON_SPIRIT_WVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING ) |
44 |
| - bool json_spirit::read( const std::wstring& s, wValue& value ) |
45 |
| - { |
46 |
| - return read_string( s, value ); |
47 |
| - } |
48 |
| - |
49 |
| - void json_spirit::read_or_throw( const std::wstring& s, wValue& value ) |
50 |
| - { |
51 |
| - read_string_or_throw( s, value ); |
52 |
| - } |
53 |
| - |
54 |
| - bool json_spirit::read( std::wistream& is, wValue& value ) |
55 |
| - { |
56 |
| - return read_stream( is, value ); |
57 |
| - } |
58 |
| - |
59 |
| - void json_spirit::read_or_throw( std::wistream& is, wValue& value ) |
60 |
| - { |
61 |
| - read_stream_or_throw( is, value ); |
62 |
| - } |
63 |
| - |
64 |
| - bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) |
65 |
| - { |
66 |
| - return read_range( begin, end, value ); |
67 |
| - } |
68 |
| - |
69 |
| - void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ) |
70 |
| - { |
71 |
| - begin = read_range_or_throw( begin, end, value ); |
72 |
| - } |
73 | 73 | #endif
|
74 | 74 |
|
75 |
| -#ifdef JSON_SPIRIT_MVALUE_ENABLED |
76 |
| - bool json_spirit::read( const std::string& s, mValue& value ) |
77 |
| - { |
78 |
| - return read_string( s, value ); |
79 |
| - } |
80 |
| - |
81 |
| - void json_spirit::read_or_throw( const std::string& s, mValue& value ) |
82 |
| - { |
83 |
| - read_string_or_throw( s, value ); |
84 |
| - } |
85 |
| - |
86 |
| - bool json_spirit::read( std::istream& is, mValue& value ) |
87 |
| - { |
88 |
| - return read_stream( is, value ); |
89 |
| - } |
90 |
| - |
91 |
| - void json_spirit::read_or_throw( std::istream& is, mValue& value ) |
92 |
| - { |
93 |
| - read_stream_or_throw( is, value ); |
94 |
| - } |
95 |
| - |
96 |
| - bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) |
97 |
| - { |
98 |
| - return read_range( begin, end, value ); |
99 |
| - } |
100 |
| - |
101 |
| - void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) |
102 |
| - { |
103 |
| - begin = read_range_or_throw( begin, end, value ); |
104 |
| - } |
105 |
| -#endif |
| 75 | +bool json_spirit::read( const std::string& s, mValue& value ) |
| 76 | +{ |
| 77 | + return read_string( s, value ); |
| 78 | +} |
| 79 | + |
| 80 | +void json_spirit::read_or_throw( const std::string& s, mValue& value ) |
| 81 | +{ |
| 82 | + read_string_or_throw( s, value ); |
| 83 | +} |
| 84 | + |
| 85 | +bool json_spirit::read( std::istream& is, mValue& value ) |
| 86 | +{ |
| 87 | + return read_stream( is, value ); |
| 88 | +} |
| 89 | + |
| 90 | +void json_spirit::read_or_throw( std::istream& is, mValue& value ) |
| 91 | +{ |
| 92 | + read_stream_or_throw( is, value ); |
| 93 | +} |
| 94 | + |
| 95 | +bool json_spirit::read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) |
| 96 | +{ |
| 97 | + return read_range( begin, end, value ); |
| 98 | +} |
| 99 | + |
| 100 | +void json_spirit::read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ) |
| 101 | +{ |
| 102 | + begin = read_range_or_throw( begin, end, value ); |
| 103 | +} |
| 104 | + |
| 105 | +#ifndef BOOST_NO_STD_WSTRING |
| 106 | + |
| 107 | +bool json_spirit::read( const std::wstring& s, wmValue& value ) |
| 108 | +{ |
| 109 | + return read_string( s, value ); |
| 110 | +} |
| 111 | + |
| 112 | +void json_spirit::read_or_throw( const std::wstring& s, wmValue& value ) |
| 113 | +{ |
| 114 | + read_string_or_throw( s, value ); |
| 115 | +} |
| 116 | + |
| 117 | +bool json_spirit::read( std::wistream& is, wmValue& value ) |
| 118 | +{ |
| 119 | + return read_stream( is, value ); |
| 120 | +} |
| 121 | + |
| 122 | +void json_spirit::read_or_throw( std::wistream& is, wmValue& value ) |
| 123 | +{ |
| 124 | + read_stream_or_throw( is, value ); |
| 125 | +} |
| 126 | + |
| 127 | +bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) |
| 128 | +{ |
| 129 | + return read_range( begin, end, value ); |
| 130 | +} |
| 131 | + |
| 132 | +void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) |
| 133 | +{ |
| 134 | + begin = read_range_or_throw( begin, end, value ); |
| 135 | +} |
106 | 136 |
|
107 |
| -#if defined( JSON_SPIRIT_WMVALUE_ENABLED ) && !defined( BOOST_NO_STD_WSTRING ) |
108 |
| - bool json_spirit::read( const std::wstring& s, wmValue& value ) |
109 |
| - { |
110 |
| - return read_string( s, value ); |
111 |
| - } |
112 |
| - |
113 |
| - void json_spirit::read_or_throw( const std::wstring& s, wmValue& value ) |
114 |
| - { |
115 |
| - read_string_or_throw( s, value ); |
116 |
| - } |
117 |
| - |
118 |
| - bool json_spirit::read( std::wistream& is, wmValue& value ) |
119 |
| - { |
120 |
| - return read_stream( is, value ); |
121 |
| - } |
122 |
| - |
123 |
| - void json_spirit::read_or_throw( std::wistream& is, wmValue& value ) |
124 |
| - { |
125 |
| - read_stream_or_throw( is, value ); |
126 |
| - } |
127 |
| - |
128 |
| - bool json_spirit::read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) |
129 |
| - { |
130 |
| - return read_range( begin, end, value ); |
131 |
| - } |
132 |
| - |
133 |
| - void json_spirit::read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ) |
134 |
| - { |
135 |
| - begin = read_range_or_throw( begin, end, value ); |
136 |
| - } |
137 | 137 | #endif
|
0 commit comments