]> git.lizzy.rs Git - dragonfireclient.git/blob - lib/jsoncpp/json/json-forwards.h
Add depth sorting for node faces (#11696)
[dragonfireclient.git] / lib / jsoncpp / json / json-forwards.h
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/version.h
84 // //////////////////////////////////////////////////////////////////////
85
86 #ifndef JSON_VERSION_H_INCLUDED
87 #define JSON_VERSION_H_INCLUDED
88
89 // Note: version must be updated in three places when doing a release. This
90 // annoying process ensures that amalgamate, CMake, and meson all report the
91 // correct version.
92 // 1. /meson.build
93 // 2. /include/json/version.h
94 // 3. /CMakeLists.txt
95 // IMPORTANT: also update the SOVERSION!!
96
97 #define JSONCPP_VERSION_STRING "1.9.4"
98 #define JSONCPP_VERSION_MAJOR 1
99 #define JSONCPP_VERSION_MINOR 9
100 #define JSONCPP_VERSION_PATCH 3
101 #define JSONCPP_VERSION_QUALIFIER
102 #define JSONCPP_VERSION_HEXA                                                   \
103   ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) |             \
104    (JSONCPP_VERSION_PATCH << 8))
105
106 #ifdef JSONCPP_USING_SECURE_MEMORY
107 #undef JSONCPP_USING_SECURE_MEMORY
108 #endif
109 #define JSONCPP_USING_SECURE_MEMORY 0
110 // If non-zero, the library zeroes any memory that it has allocated before
111 // it frees its memory.
112
113 #endif // JSON_VERSION_H_INCLUDED
114
115 // //////////////////////////////////////////////////////////////////////
116 // End of content of file: include/json/version.h
117 // //////////////////////////////////////////////////////////////////////
118
119
120
121
122
123
124 // //////////////////////////////////////////////////////////////////////
125 // Beginning of content of file: include/json/allocator.h
126 // //////////////////////////////////////////////////////////////////////
127
128 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
129 // Distributed under MIT license, or public domain if desired and
130 // recognized in your jurisdiction.
131 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
132
133 #ifndef JSON_ALLOCATOR_H_INCLUDED
134 #define JSON_ALLOCATOR_H_INCLUDED
135
136 #include <cstring>
137 #include <memory>
138
139 #pragma pack(push, 8)
140
141 namespace Json {
142 template <typename T> class SecureAllocator {
143 public:
144   // Type definitions
145   using value_type = T;
146   using pointer = T*;
147   using const_pointer = const T*;
148   using reference = T&;
149   using const_reference = const T&;
150   using size_type = std::size_t;
151   using difference_type = std::ptrdiff_t;
152
153   /**
154    * Allocate memory for N items using the standard allocator.
155    */
156   pointer allocate(size_type n) {
157     // allocate using "global operator new"
158     return static_cast<pointer>(::operator new(n * sizeof(T)));
159   }
160
161   /**
162    * Release memory which was allocated for N items at pointer P.
163    *
164    * The memory block is filled with zeroes before being released.
165    * The pointer argument is tagged as "volatile" to prevent the
166    * compiler optimizing out this critical step.
167    */
168   void deallocate(volatile pointer p, size_type n) {
169     std::memset(p, 0, n * sizeof(T));
170     // free using "global operator delete"
171     ::operator delete(p);
172   }
173
174   /**
175    * Construct an item in-place at pointer P.
176    */
177   template <typename... Args> void construct(pointer p, Args&&... args) {
178     // construct using "placement new" and "perfect forwarding"
179     ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
180   }
181
182   size_type max_size() const { return size_t(-1) / sizeof(T); }
183
184   pointer address(reference x) const { return std::addressof(x); }
185
186   const_pointer address(const_reference x) const { return std::addressof(x); }
187
188   /**
189    * Destroy an item in-place at pointer P.
190    */
191   void destroy(pointer p) {
192     // destroy using "explicit destructor"
193     p->~T();
194   }
195
196   // Boilerplate
197   SecureAllocator() {}
198   template <typename U> SecureAllocator(const SecureAllocator<U>&) {}
199   template <typename U> struct rebind { using other = SecureAllocator<U>; };
200 };
201
202 template <typename T, typename U>
203 bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
204   return true;
205 }
206
207 template <typename T, typename U>
208 bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
209   return false;
210 }
211
212 } // namespace Json
213
214 #pragma pack(pop)
215
216 #endif // JSON_ALLOCATOR_H_INCLUDED
217
218 // //////////////////////////////////////////////////////////////////////
219 // End of content of file: include/json/allocator.h
220 // //////////////////////////////////////////////////////////////////////
221
222
223
224
225
226
227 // //////////////////////////////////////////////////////////////////////
228 // Beginning of content of file: include/json/config.h
229 // //////////////////////////////////////////////////////////////////////
230
231 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
232 // Distributed under MIT license, or public domain if desired and
233 // recognized in your jurisdiction.
234 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
235
236 #ifndef JSON_CONFIG_H_INCLUDED
237 #define JSON_CONFIG_H_INCLUDED
238 #include <cstddef>
239 #include <cstdint>
240 #include <istream>
241 #include <memory>
242 #include <ostream>
243 #include <sstream>
244 #include <string>
245 #include <type_traits>
246
247 // If non-zero, the library uses exceptions to report bad input instead of C
248 // assertion macros. The default is to use exceptions.
249 #ifndef JSON_USE_EXCEPTION
250 #define JSON_USE_EXCEPTION 1
251 #endif
252
253 // Temporary, tracked for removal with issue #982.
254 #ifndef JSON_USE_NULLREF
255 #define JSON_USE_NULLREF 1
256 #endif
257
258 /// If defined, indicates that the source file is amalgamated
259 /// to prevent private header inclusion.
260 /// Remarks: it is automatically defined in the generated amalgamated header.
261 // #define JSON_IS_AMALGAMATION
262
263 // Export macros for DLL visibility
264 #if defined(JSON_DLL_BUILD)
265 #if defined(_MSC_VER) || defined(__MINGW32__)
266 #define JSON_API __declspec(dllexport)
267 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
268 #elif defined(__GNUC__) || defined(__clang__)
269 #define JSON_API __attribute__((visibility("default")))
270 #endif // if defined(_MSC_VER)
271
272 #elif defined(JSON_DLL)
273 #if defined(_MSC_VER) || defined(__MINGW32__)
274 #define JSON_API __declspec(dllimport)
275 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
276 #endif // if defined(_MSC_VER)
277 #endif // ifdef JSON_DLL_BUILD
278
279 #if !defined(JSON_API)
280 #define JSON_API
281 #endif
282
283 #if defined(_MSC_VER) && _MSC_VER < 1800
284 #error                                                                         \
285     "ERROR:  Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
286 #endif
287
288 #if defined(_MSC_VER) && _MSC_VER < 1900
289 // As recommended at
290 // https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
291 extern JSON_API int msvc_pre1900_c99_snprintf(char* outBuf, size_t size,
292                                               const char* format, ...);
293 #define jsoncpp_snprintf msvc_pre1900_c99_snprintf
294 #else
295 #define jsoncpp_snprintf std::snprintf
296 #endif
297
298 // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
299 // integer
300 // Storages, and 64 bits integer support is disabled.
301 // #define JSON_NO_INT64 1
302
303 // JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.
304 // C++11 should be used directly in JSONCPP.
305 #define JSONCPP_OVERRIDE override
306
307 #ifdef __clang__
308 #if __has_extension(attribute_deprecated_with_message)
309 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
310 #endif
311 #elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc)
312 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
313 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
314 #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
315 #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
316 #endif                  // GNUC version
317 #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates
318                         // MSVC)
319 #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
320 #endif // __clang__ || __GNUC__ || _MSC_VER
321
322 #if !defined(JSONCPP_DEPRECATED)
323 #define JSONCPP_DEPRECATED(message)
324 #endif // if !defined(JSONCPP_DEPRECATED)
325
326 #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6))
327 #define JSON_USE_INT64_DOUBLE_CONVERSION 1
328 #endif
329
330 #if !defined(JSON_IS_AMALGAMATION)
331
332 #include "allocator.h"
333 #include "version.h"
334
335 #endif // if !defined(JSON_IS_AMALGAMATION)
336
337 namespace Json {
338 using Int = int;
339 using UInt = unsigned int;
340 #if defined(JSON_NO_INT64)
341 using LargestInt = int;
342 using LargestUInt = unsigned int;
343 #undef JSON_HAS_INT64
344 #else                 // if defined(JSON_NO_INT64)
345 // For Microsoft Visual use specific types as long long is not supported
346 #if defined(_MSC_VER) // Microsoft Visual Studio
347 using Int64 = __int64;
348 using UInt64 = unsigned __int64;
349 #else                 // if defined(_MSC_VER) // Other platforms, use long long
350 using Int64 = int64_t;
351 using UInt64 = uint64_t;
352 #endif                // if defined(_MSC_VER)
353 using LargestInt = Int64;
354 using LargestUInt = UInt64;
355 #define JSON_HAS_INT64
356 #endif // if defined(JSON_NO_INT64)
357
358 template <typename T>
359 using Allocator =
360     typename std::conditional<JSONCPP_USING_SECURE_MEMORY, SecureAllocator<T>,
361                               std::allocator<T>>::type;
362 using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
363 using IStringStream =
364     std::basic_istringstream<String::value_type, String::traits_type,
365                              String::allocator_type>;
366 using OStringStream =
367     std::basic_ostringstream<String::value_type, String::traits_type,
368                              String::allocator_type>;
369 using IStream = std::istream;
370 using OStream = std::ostream;
371 } // namespace Json
372
373 // Legacy names (formerly macros).
374 using JSONCPP_STRING = Json::String;
375 using JSONCPP_ISTRINGSTREAM = Json::IStringStream;
376 using JSONCPP_OSTRINGSTREAM = Json::OStringStream;
377 using JSONCPP_ISTREAM = Json::IStream;
378 using JSONCPP_OSTREAM = Json::OStream;
379
380 #endif // JSON_CONFIG_H_INCLUDED
381
382 // //////////////////////////////////////////////////////////////////////
383 // End of content of file: include/json/config.h
384 // //////////////////////////////////////////////////////////////////////
385
386
387
388
389
390
391 // //////////////////////////////////////////////////////////////////////
392 // Beginning of content of file: include/json/forwards.h
393 // //////////////////////////////////////////////////////////////////////
394
395 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
396 // Distributed under MIT license, or public domain if desired and
397 // recognized in your jurisdiction.
398 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
399
400 #ifndef JSON_FORWARDS_H_INCLUDED
401 #define JSON_FORWARDS_H_INCLUDED
402
403 #if !defined(JSON_IS_AMALGAMATION)
404 #include "config.h"
405 #endif // if !defined(JSON_IS_AMALGAMATION)
406
407 namespace Json {
408
409 // writer.h
410 class StreamWriter;
411 class StreamWriterBuilder;
412 class Writer;
413 class FastWriter;
414 class StyledWriter;
415 class StyledStreamWriter;
416
417 // reader.h
418 class Reader;
419 class CharReader;
420 class CharReaderBuilder;
421
422 // json_features.h
423 class Features;
424
425 // value.h
426 using ArrayIndex = unsigned int;
427 class StaticString;
428 class Path;
429 class PathArgument;
430 class Value;
431 class ValueIteratorBase;
432 class ValueIterator;
433 class ValueConstIterator;
434
435 } // namespace Json
436
437 #endif // JSON_FORWARDS_H_INCLUDED
438
439 // //////////////////////////////////////////////////////////////////////
440 // End of content of file: include/json/forwards.h
441 // //////////////////////////////////////////////////////////////////////
442
443
444
445
446
447 #endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED