json-forwards.h
Go to the documentation of this file.
1 
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 #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 
103 //# define JSON_IN_CPPTL 1
104 
106 //# define JSON_USE_CPPTL 1
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 
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 #elif defined(__GNUC__) || defined(__clang__)
137 #define JSON_API __attribute__((visibility("default")))
138 #endif // if defined(_MSC_VER)
139 #elif defined(JSON_DLL)
140 #if defined(_MSC_VER) || defined(__MINGW32__)
141 #define JSON_API __declspec(dllimport)
142 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
143 #endif // if defined(_MSC_VER)
144 #endif // ifdef JSON_IN_CPPTL
145 #if !defined(JSON_API)
146 #define JSON_API
147 #endif
148 
149 #if defined(_MSC_VER) && _MSC_VER < 1800
150 #error \
151  "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities"
152 #endif
153 
154 #if defined(_MSC_VER) && _MSC_VER < 1900
155 // As recommended at
156 // https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010
157 extern JSON_API int
158 msvc_pre1900_c99_snprintf(char* outBuf, size_t size, const char* format, ...);
159 #define jsoncpp_snprintf msvc_pre1900_c99_snprintf
160 #else
161 #define jsoncpp_snprintf std::snprintf
162 #endif
163 
164 // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
165 // integer
166 // Storages, and 64 bits integer support is disabled.
167 // #define JSON_NO_INT64 1
168 
169 // JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools.
170 // C++11 should be used directly in JSONCPP.
171 #define JSONCPP_OVERRIDE override
172 
173 #if __cplusplus >= 201103L
174 #define JSONCPP_NOEXCEPT noexcept
175 #define JSONCPP_OP_EXPLICIT explicit
176 #elif defined(_MSC_VER) && _MSC_VER < 1900
177 #define JSONCPP_NOEXCEPT throw()
178 #define JSONCPP_OP_EXPLICIT explicit
179 #elif defined(_MSC_VER) && _MSC_VER >= 1900
180 #define JSONCPP_NOEXCEPT noexcept
181 #define JSONCPP_OP_EXPLICIT explicit
182 #else
183 #define JSONCPP_NOEXCEPT throw()
184 #define JSONCPP_OP_EXPLICIT
185 #endif
186 
187 #ifdef __clang__
188 #if __has_extension(attribute_deprecated_with_message)
189 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
190 #endif
191 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
192 #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
193 #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message)))
194 #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
195 #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
196 #endif // GNUC version
197 #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates MSVC)
198 #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
199 #endif // __clang__ || __GNUC__ || _MSC_VER
200 
201 #if !defined(JSONCPP_DEPRECATED)
202 #define JSONCPP_DEPRECATED(message)
203 #endif // if !defined(JSONCPP_DEPRECATED)
204 
205 #if __GNUC__ >= 6
206 #define JSON_USE_INT64_DOUBLE_CONVERSION 1
207 #endif
208 
209 #if !defined(JSON_IS_AMALGAMATION)
210 
211 #include "allocator.h"
212 #include "version.h"
213 
214 #endif // if !defined(JSON_IS_AMALGAMATION)
215 
216 namespace Json {
217 typedef int Int;
218 typedef unsigned int UInt;
219 #if defined(JSON_NO_INT64)
220 typedef int LargestInt;
221 typedef unsigned int LargestUInt;
222 #undef JSON_HAS_INT64
223 #else // if defined(JSON_NO_INT64)
224 // For Microsoft Visual use specific types as long long is not supported
225 #if defined(_MSC_VER) // Microsoft Visual Studio
226 typedef __int64 Int64;
227 typedef unsigned __int64 UInt64;
228 #else // if defined(_MSC_VER) // Other platforms, use long long
229 typedef int64_t Int64;
230 typedef uint64_t UInt64;
231 #endif // if defined(_MSC_VER)
232 typedef Int64 LargestInt;
233 typedef UInt64 LargestUInt;
234 #define JSON_HAS_INT64
235 #endif // if defined(JSON_NO_INT64)
236 
237 template <typename T>
238 using Allocator = typename std::conditional<JSONCPP_USING_SECURE_MEMORY,
239  SecureAllocator<T>,
240  std::allocator<T>>::type;
241 using String = std::basic_string<char, std::char_traits<char>, Allocator<char>>;
242 using IStringStream = std::basic_istringstream<String::value_type,
243  String::traits_type,
244  String::allocator_type>;
245 using OStringStream = std::basic_ostringstream<String::value_type,
246  String::traits_type,
247  String::allocator_type>;
248 using IStream = std::istream;
249 using OStream = std::ostream;
250 } // namespace Json
251 
252 // Legacy names (formerly macros).
258 
259 #endif // JSON_CONFIG_H_INCLUDED
260 
261 // //////////////////////////////////////////////////////////////////////
262 // End of content of file: include/json/config.h
263 // //////////////////////////////////////////////////////////////////////
264 
265 
266 
267 
268 
269 
270 // //////////////////////////////////////////////////////////////////////
271 // Beginning of content of file: include/json/forwards.h
272 // //////////////////////////////////////////////////////////////////////
273 
274 // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors
275 // Distributed under MIT license, or public domain if desired and
276 // recognized in your jurisdiction.
277 // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
278 
279 #ifndef JSON_FORWARDS_H_INCLUDED
280 #define JSON_FORWARDS_H_INCLUDED
281 
282 #if !defined(JSON_IS_AMALGAMATION)
283 #include "config.h"
284 #endif // if !defined(JSON_IS_AMALGAMATION)
285 
286 namespace Json {
287 
288 // writer.h
289 class FastWriter;
290 class StyledWriter;
291 
292 // reader.h
293 class Reader;
294 
295 // features.h
296 class Features;
297 
298 // value.h
299 typedef unsigned int ArrayIndex;
300 class StaticString;
301 class Path;
302 class PathArgument;
303 class Value;
304 class ValueIteratorBase;
305 class ValueIterator;
306 class ValueConstIterator;
307 
308 } // namespace Json
309 
310 #endif // JSON_FORWARDS_H_INCLUDED
311 
312 // //////////////////////////////////////////////////////////////////////
313 // End of content of file: include/json/forwards.h
314 // //////////////////////////////////////////////////////////////////////
315 
316 
317 
318 
319 
320 #endif //ifndef JSON_FORWARD_AMALGAMATED_H_INCLUDED
unsigned int UInt
Definition: json-forwards.h:218
UInt64 LargestUInt
Definition: json-forwards.h:233
Json::IStream JSONCPP_ISTREAM
Definition: json-forwards.h:256
Experimental and untested: represents an element of the "path" to access a node.
Definition: json.h:1213
Lightweight wrapper to tag static string.
Definition: json.h:678
#define JSON_API
Definition: json-forwards.h:146
unsigned int ArrayIndex
Definition: json-forwards.h:296
Represents a JSON value.
Definition: json.h:724
std::basic_istringstream< String::value_type, String::traits_type, String::allocator_type > IStringStream
Definition: json-forwards.h:244
Configuration passed to reader and writer. This configuration object can be used to force the Reader ...
Definition: json.h:483
Json::IStringStream JSONCPP_ISTRINGSTREAM
Definition: json-forwards.h:254
#define JSONCPP_USING_SECURE_MEMORY
Definition: json.h:102
Int64 LargestInt
Definition: json-forwards.h:232
Json::OStringStream JSONCPP_OSTRINGSTREAM
Definition: json-forwards.h:255
JSON (JavaScript Object Notation).
Definition: json-forwards.h:216
base class for Value iterators.
Definition: json.h:1272
typename std::conditional< JSONCPP_USING_SECURE_MEMORY, SecureAllocator< T >, std::allocator< T >>::type Allocator
Definition: json-forwards.h:240
int Int
Definition: json-forwards.h:217
Json::String JSONCPP_STRING
Definition: json-forwards.h:253
std::ostream OStream
Definition: json-forwards.h:249
std::istream IStream
Definition: json-forwards.h:248
std::basic_ostringstream< String::value_type, String::traits_type, String::allocator_type > OStringStream
Definition: json-forwards.h:247
uint64_t UInt64
Definition: json-forwards.h:230
std::basic_string< char, std::char_traits< char >, Allocator< char >> String
Definition: json-forwards.h:241
Iterator for object and array value.
Definition: json.h:1390
Json::OStream JSONCPP_OSTREAM
Definition: json-forwards.h:257
Experimental and untested: represents a "path" to access a node.
Definition: json.h:1240
const iterator for object and array value.
Definition: json.h:1339
int64_t Int64
Definition: json-forwards.h:229