499
|
1 /// Json-cpp amalgamated forward header (http://jsoncpp.sourceforge.net/).
|
|
2 /// It is intended to be used with #include "json/json-forwards.h"
|
|
3 /// This header provides forward declaration for all JsonCpp types.
|
|
4
|
|
5 // //////////////////////////////////////////////////////////////////////
|
|
6 // Beginning of content of file: LICENSE
|
|
7 // //////////////////////////////////////////////////////////////////////
|
|
8
|
|
9 /*
|
|
10 The JsonCpp library's source code, including accompanying documentation,
|
|
11 tests and demonstration applications, are licensed under the following
|
|
12 conditions...
|
|
13
|
|
14 Baptiste Lepilleur and The JsonCpp Authors explicitly disclaim copyright in all
|
|
15 jurisdictions which recognize such a disclaimer. In such jurisdictions,
|
|
16 this software is released into the Public Domain.
|
|
17
|
|
18 In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
|
|
19 2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur and
|
|
20 The JsonCpp Authors, and is released under the terms of the MIT License (see below).
|
|
21
|
|
22 In jurisdictions which recognize Public Domain property, the user of this
|
|
23 software may choose to accept it either as 1) Public Domain, 2) under the
|
|
24 conditions of the MIT License (see below), or 3) under the terms of dual
|
|
25 Public Domain/MIT License conditions described here, as they choose.
|
|
26
|
|
27 The MIT License is about as close to Public Domain as a license can get, and is
|
|
28 described in clear, concise terms at:
|
|
29
|
|
30 http://en.wikipedia.org/wiki/MIT_License
|
|
31
|
|
32 The full text of the MIT License follows:
|
|
33
|
|
34 ========================================================================
|
|
35 Copyright (c) 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
|
36
|
|
37 Permission is hereby granted, free of charge, to any person
|
|
38 obtaining a copy of this software and associated documentation
|
|
39 files (the "Software"), to deal in the Software without
|
|
40 restriction, including without limitation the rights to use, copy,
|
|
41 modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
42 of the Software, and to permit persons to whom the Software is
|
|
43 furnished to do so, subject to the following conditions:
|
|
44
|
|
45 The above copyright notice and this permission notice shall be
|
|
46 included in all copies or substantial portions of the Software.
|
|
47
|
|
48 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
49 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
50 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
51 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
52 BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
53 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
54 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
55 SOFTWARE.
|
|
56 ========================================================================
|
|
57 (END LICENSE TEXT)
|
|
58
|
|
59 The MIT license is compatible with both the GPL and commercial
|
|
60 software, affording one all of the rights of Public Domain with the
|
|
61 minor nuisance of being required to keep the above copyright notice
|
|
62 and license text in the source code. Note also that by accepting the
|
|
63 Public Domain "license" you can re-license your copy using whatever
|
|
64 license you like.
|
|
65
|
|
66 */
|
|
67
|
|
68 // //////////////////////////////////////////////////////////////////////
|
|
69 // End of content of file: LICENSE
|
|
70 // //////////////////////////////////////////////////////////////////////
|
|
71
|
|
72
|
|
73
|
|
74
|
|
75
|
|
76 #ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED
|
|
77 # define JSON_FORWARD_AMALGAMATED_H_INCLUDED
|
|
78 /// If defined, indicates that the source file is amalgamated
|
|
79 /// to prevent private header inclusion.
|
|
80 #define JSON_IS_AMALGAMATION
|
|
81
|
|
82 // //////////////////////////////////////////////////////////////////////
|
|
83 // Beginning of content of file: include/json/config.h
|
|
84 // //////////////////////////////////////////////////////////////////////
|
|
85
|
|
86 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
|
87 // Distributed under MIT license, or public domain if desired and
|
|
88 // recognized in your jurisdiction.
|
|
89 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
|
90
|
|
91 #ifndef JSON_CONFIG_H_INCLUDED
|
|
92 #define JSON_CONFIG_H_INCLUDED
|
|
93 #include <cstddef>
|
|
94 #include <cstdint>
|
|
95 #include <istream>
|
|
96 #include <memory>
|
|
97 #include <ostream>
|
|
98 #include <sstream>
|
|
99 #include <string>
|
|
100 #include <type_traits>
|
|
101
|
|
102 /// If defined, indicates that json library is embedded in CppTL library.
|
|
103 //# define JSON_IN_CPPTL 1
|
|
104
|
|
105 /// If defined, indicates that json may leverage CppTL library
|
|
106 //# define JSON_USE_CPPTL 1
|
|
107 /// If defined, indicates that cpptl vector based map should be used instead of
|
|
108 /// std::map
|
|
109 /// as Value container.
|
|
110 //# define JSON_USE_CPPTL_SMALLMAP 1
|
|
111
|
|
112 // If non-zero, the library uses exceptions to report bad input instead of C
|
|
113 // assertion macros. The default is to use exceptions.
|
|
114 #ifndef JSON_USE_EXCEPTION
|
|
115 #define JSON_USE_EXCEPTION 1
|
|
116 #endif
|
|
117
|
|
118 /// If defined, indicates that the source file is amalgamated
|
|
119 /// to prevent private header inclusion.
|
|
120 /// Remarks: it is automatically defined in the generated amalgamated header.
|
|
121 // #define JSON_IS_AMALGAMATION
|
|
122
|
|
123 #ifdef JSON_IN_CPPTL
|
|
124 #include <cpptl/config.h>
|
|
125 #ifndef JSON_USE_CPPTL
|
|
126 #define JSON_USE_CPPTL 1
|
|
127 #endif
|
|
128 #endif
|
|
129
|
|
130 #ifdef JSON_IN_CPPTL
|
|
131 #define JSON_API CPPTL_API
|
|
132 #elif defined(JSON_DLL_BUILD)
|
|
133 #if defined(_MSC_VER) || defined(__MINGW32__)
|
|
134 #define JSON_API __declspec(dllexport)
|
|
135 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
|
|
136 #endif // if defined(_MSC_VER)
|
|
137 #elif defined(JSON_DLL)
|
|
138 #if defined(_MSC_VER) || defined(__MINGW32__)
|
|
139 #define JSON_API __declspec(dllimport)
|
|
140 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
|
|
141 #endif // if defined(_MSC_VER)
|
|
142 #endif // ifdef JSON_IN_CPPTL
|
|
143 #if !defined(JSON_API)
|
|
144 #define JSON_API
|
|
145 #endif
|
|
146
|
|
147 #if defined(_MSC_VER) && _MSC_VER < 1800
|
|
148 #error \
|
|
149 "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
|
|
150 #endif
|
|
151
|
|
152 #if defined(_MSC_VER) && _MSC_VER < 1900
|
|
153 // As recommended at
|
|
154 // https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
|
|
155 extern JSON_API int
|
|
156 msvc_pre1900_c99_snprintf(char* outBuf, size_t size, const char* format, ...);
|
|
157 #define jsoncpp_snprintf msvc_pre1900_c99_snprintf
|
|
158 #else
|
|
159 #define jsoncpp_snprintf std::snprintf
|
|
160 #endif
|
|
161
|
|
162 // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
|
|
163 // integer
|
|
164 // Storages, and 64 bits integer support is disabled.
|
|
165 // #define JSON_NO_INT64 1
|
|
166
|
|
167 #if defined(_MSC_VER) // MSVC
|
|
168 #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
|
|
169 #endif // defined(_MSC_VER)
|
|
170
|
|
171 // JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.
|
|
172 // C++11 should be used directly in JSONCPP.
|
|
173 #define JSONCPP_OVERRIDE override
|
|
174
|
|
175 #if __cplusplus >= 201103L
|
|
176 #define JSONCPP_NOEXCEPT noexcept
|
|
177 #define JSONCPP_OP_EXPLICIT explicit
|
|
178 #elif defined(_MSC_VER) && _MSC_VER < 1900
|
|
179 #define JSONCPP_NOEXCEPT throw()
|
|
180 #define JSONCPP_OP_EXPLICIT explicit
|
|
181 #elif defined(_MSC_VER) && _MSC_VER >= 1900
|
|
182 #define JSONCPP_NOEXCEPT noexcept
|
|
183 #define JSONCPP_OP_EXPLICIT explicit
|
|
184 #else
|
|
185 #define JSONCPP_NOEXCEPT throw()
|
|
186 #define JSONCPP_OP_EXPLICIT
|
|
187 #endif
|
|
188
|
|
189 #ifndef JSON_HAS_RVALUE_REFERENCES
|
|
190
|
|
191 #if defined(_MSC_VER)
|
|
192 #define JSON_HAS_RVALUE_REFERENCES 1
|
|
193 #endif // MSVC >= 2013
|
|
194
|
|
195 #ifdef __clang__
|
|
196 #if __has_feature(cxx_rvalue_references)
|
|
197 #define JSON_HAS_RVALUE_REFERENCES 1
|
|
198 #endif // has_feature
|
|
199
|
|
200 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
|
|
201 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
|
|
202 #define JSON_HAS_RVALUE_REFERENCES 1
|
|
203 #endif // GXX_EXPERIMENTAL
|
|
204
|
|
205 #endif // __clang__ || __GNUC__
|
|
206
|
|
207 #endif // not defined JSON_HAS_RVALUE_REFERENCES
|
|
208
|
|
209 #ifndef JSON_HAS_RVALUE_REFERENCES
|
|
210 #define JSON_HAS_RVALUE_REFERENCES 0
|
|
211 #endif
|
|
212
|
|
213 #ifdef __clang__
|
|
214 #if __has_extension(attribute_deprecated_with_message)
|
|
215 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
|
|
216 #endif
|
|
217 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
|
|
218 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
|
|
219 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
|
|
220 #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
|
|
221 #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
|
|
222 #endif // GNUC version
|
|
223 #endif // __clang__ || __GNUC__
|
|
224
|
|
225 #if !defined(JSONCPP_DEPRECATED)
|
|
226 #define JSONCPP_DEPRECATED(message)
|
|
227 #endif // if !defined(JSONCPP_DEPRECATED)
|
|
228
|
|
229 #if __GNUC__ >= 6
|
|
230 #define JSON_USE_INT64_DOUBLE_CONVERSION 1
|
|
231 #endif
|
|
232
|
|
233 #if !defined(JSON_IS_AMALGAMATION)
|
|
234
|
|
235 #include "allocator.h"
|
|
236 #include "version.h"
|
|
237
|
|
238 #endif // if !defined(JSON_IS_AMALGAMATION)
|
|
239
|
|
240 namespace Json {
|
|
241 typedef int Int;
|
|
242 typedef unsigned int UInt;
|
|
243 #if defined(JSON_NO_INT64)
|
|
244 typedef int LargestInt;
|
|
245 typedef unsigned int LargestUInt;
|
|
246 #undef JSON_HAS_INT64
|
|
247 #else // if defined(JSON_NO_INT64)
|
|
248 // For Microsoft Visual use specific types as long long is not supported
|
|
249 #if defined(_MSC_VER) // Microsoft Visual Studio
|
|
250 typedef __int64 Int64;
|
|
251 typedef unsigned __int64 UInt64;
|
|
252 #else // if defined(_MSC_VER) // Other platforms, use long long
|
|
253 typedef int64_t Int64;
|
|
254 typedef uint64_t UInt64;
|
|
255 #endif // if defined(_MSC_VER)
|
|
256 typedef Int64 LargestInt;
|
|
257 typedef UInt64 LargestUInt;
|
|
258 #define JSON_HAS_INT64
|
|
259 #endif // if defined(JSON_NO_INT64)
|
|
260
|
|
261 template <typename T>
|
|
262 using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY,
|
|
263 SecureAllocator<T>,
|
|
264 std::allocator<T>>::type;
|
|
265 using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
|
|
266 using IStringStream = std::basic_istringstream<String::value_type,
|
|
267 String::traits_type,
|
|
268 String::allocator_type>;
|
|
269 using OStringStream = std::basic_ostringstream<String::value_type,
|
|
270 String::traits_type,
|
|
271 String::allocator_type>;
|
|
272 using IStream = std::istream;
|
|
273 using OStream = std::ostream;
|
|
274 } // namespace Json
|
|
275
|
|
276 // Legacy names (formerly macros).
|
|
277 using JSONCPP_STRING = Json::String;
|
|
278 using JSONCPP_ISTRINGSTREAM = Json::IStringStream;
|
|
279 using JSONCPP_OSTRINGSTREAM = Json::OStringStream;
|
|
280 using JSONCPP_ISTREAM = Json::IStream;
|
|
281 using JSONCPP_OSTREAM = Json::OStream;
|
|
282
|
|
283 #endif // JSON_CONFIG_H_INCLUDED
|
|
284
|
|
285 // //////////////////////////////////////////////////////////////////////
|
|
286 // End of content of file: include/json/config.h
|
|
287 // //////////////////////////////////////////////////////////////////////
|
|
288
|
|
289
|
|
290
|
|
291
|
|
292
|
|
293
|
|
294 // //////////////////////////////////////////////////////////////////////
|
|
295 // Beginning of content of file: include/json/forwards.h
|
|
296 // //////////////////////////////////////////////////////////////////////
|
|
297
|
|
298 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
|
|
299 // Distributed under MIT license, or public domain if desired and
|
|
300 // recognized in your jurisdiction.
|
|
301 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
|
302
|
|
303 #ifndef JSON_FORWARDS_H_INCLUDED
|
|
304 #define JSON_FORWARDS_H_INCLUDED
|
|
305
|
|
306 #if !defined(JSON_IS_AMALGAMATION)
|
|
307 #include "config.h"
|
|
308 #endif // if !defined(JSON_IS_AMALGAMATION)
|
|
309
|
|
310 namespace Json {
|
|
311
|
|
312 // writer.h
|
|
313 class FastWriter;
|
|
314 class StyledWriter;
|
|
315
|
|
316 // reader.h
|
|
317 class Reader;
|
|
318
|
|
319 // features.h
|
|
320 class Features;
|
|
321
|
|
322 // value.h
|
|
323 typedef unsigned int ArrayIndex;
|
|
324 class StaticString;
|
|
325 class Path;
|
|
326 class PathArgument;
|
|
327 class Value;
|
|
328 class ValueIteratorBase;
|
|
329 class ValueIterator;
|
|
330 class ValueConstIterator;
|
|
331
|
|
332 } // namespace Json
|
|
333
|
|
334 #endif // JSON_FORWARDS_H_INCLUDED
|
|
335
|
|
336 // //////////////////////////////////////////////////////////////////////
|
|
337 // End of content of file: include/json/forwards.h
|
|
338 // //////////////////////////////////////////////////////////////////////
|
|
339
|
|
340
|
|
341
|
|
342
|
|
343
|
|
344 #endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED
|