Skip to content

Commit 430a204

Browse files
author
a-pavlov
committed
Add jsoncpp standalone sources into project
1 parent e270346 commit 430a204

5 files changed

Lines changed: 7809 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ option (BUILD_TESTS "Build unit tests." TRUE)
55

66
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
77

8-
find_package(JsonCpp REQUIRED)
8+
#find_package(JsonCpp REQUIRED)
99
find_package(CURL REQUIRED)
1010

1111
if (BUILD_TESTS)

include/json/json-forwards.h

Lines changed: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
1+
/// Json-cpp amalgated 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+
The author (Baptiste Lepilleur) explicitly disclaims 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 is
20+
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
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_AMALGATED_H_INCLUDED
77+
# define JSON_FORWARD_AMALGATED_H_INCLUDED
78+
/// If defined, indicates that the source file is amalgated
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
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 <stddef.h>
94+
#include <string> //typdef String
95+
96+
/// If defined, indicates that json library is embedded in CppTL library.
97+
//# define JSON_IN_CPPTL 1
98+
99+
/// If defined, indicates that json may leverage CppTL library
100+
//# define JSON_USE_CPPTL 1
101+
/// If defined, indicates that cpptl vector based map should be used instead of
102+
/// std::map
103+
/// as Value container.
104+
//# define JSON_USE_CPPTL_SMALLMAP 1
105+
106+
// If non-zero, the library uses exceptions to report bad input instead of C
107+
// assertion macros. The default is to use exceptions.
108+
#ifndef JSON_USE_EXCEPTION
109+
#define JSON_USE_EXCEPTION 1
110+
#endif
111+
112+
/// If defined, indicates that the source file is amalgated
113+
/// to prevent private header inclusion.
114+
/// Remarks: it is automatically defined in the generated amalgated header.
115+
// #define JSON_IS_AMALGAMATION
116+
117+
#ifdef JSON_IN_CPPTL
118+
#include <cpptl/config.h>
119+
#ifndef JSON_USE_CPPTL
120+
#define JSON_USE_CPPTL 1
121+
#endif
122+
#endif
123+
124+
#ifdef JSON_IN_CPPTL
125+
#define JSON_API CPPTL_API
126+
#elif defined(JSON_DLL_BUILD)
127+
#if defined(_MSC_VER) || defined(__MINGW32__)
128+
#define JSON_API __declspec(dllexport)
129+
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
130+
#endif // if defined(_MSC_VER)
131+
#elif defined(JSON_DLL)
132+
#if defined(_MSC_VER) || defined(__MINGW32__)
133+
#define JSON_API __declspec(dllimport)
134+
#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
135+
#endif // if defined(_MSC_VER)
136+
#endif // ifdef JSON_IN_CPPTL
137+
#if !defined(JSON_API)
138+
#define JSON_API
139+
#endif
140+
141+
// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
142+
// integer
143+
// Storages, and 64 bits integer support is disabled.
144+
// #define JSON_NO_INT64 1
145+
146+
#if defined(_MSC_VER) // MSVC
147+
# if _MSC_VER <= 1200 // MSVC 6
148+
// Microsoft Visual Studio 6 only support conversion from __int64 to double
149+
// (no conversion from unsigned __int64).
150+
# define JSON_USE_INT64_DOUBLE_CONVERSION 1
151+
// Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
152+
// characters in the debug information)
153+
// All projects I've ever seen with VS6 were using this globally (not bothering
154+
// with pragma push/pop).
155+
# pragma warning(disable : 4786)
156+
# endif // MSVC 6
157+
158+
# if _MSC_VER >= 1500 // MSVC 2008
159+
/// Indicates that the following function is deprecated.
160+
# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
161+
# endif
162+
163+
#endif // defined(_MSC_VER)
164+
165+
#if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010
166+
# define JSONCPP_OVERRIDE
167+
#else
168+
# define JSONCPP_OVERRIDE override
169+
#endif // MSVC <= 2010
170+
171+
172+
#ifndef JSON_HAS_RVALUE_REFERENCES
173+
174+
#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
175+
#define JSON_HAS_RVALUE_REFERENCES 1
176+
#endif // MSVC >= 2010
177+
178+
#ifdef __clang__
179+
#if __has_feature(cxx_rvalue_references)
180+
#define JSON_HAS_RVALUE_REFERENCES 1
181+
#endif // has_feature
182+
183+
#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
184+
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
185+
#define JSON_HAS_RVALUE_REFERENCES 1
186+
#endif // GXX_EXPERIMENTAL
187+
188+
#endif // __clang__ || __GNUC__
189+
190+
#endif // not defined JSON_HAS_RVALUE_REFERENCES
191+
192+
#ifndef JSON_HAS_RVALUE_REFERENCES
193+
#define JSON_HAS_RVALUE_REFERENCES 0
194+
#endif
195+
196+
#ifdef __clang__
197+
#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
198+
# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
199+
# define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
200+
# elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
201+
# define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
202+
# endif // GNUC version
203+
#endif // __clang__ || __GNUC__
204+
205+
#if !defined(JSONCPP_DEPRECATED)
206+
#define JSONCPP_DEPRECATED(message)
207+
#endif // if !defined(JSONCPP_DEPRECATED)
208+
209+
#if __GNUC__ >= 6
210+
# define JSON_USE_INT64_DOUBLE_CONVERSION 1
211+
#endif
212+
213+
#if !defined(JSON_IS_AMALGAMATION)
214+
215+
# include "version.h"
216+
217+
# if JSONCPP_USING_SECURE_MEMORY
218+
# include "allocator.h" //typedef Allocator
219+
# endif
220+
221+
#endif // if !defined(JSON_IS_AMALGAMATION)
222+
223+
namespace Json {
224+
typedef int Int;
225+
typedef unsigned int UInt;
226+
#if defined(JSON_NO_INT64)
227+
typedef int LargestInt;
228+
typedef unsigned int LargestUInt;
229+
#undef JSON_HAS_INT64
230+
#else // if defined(JSON_NO_INT64)
231+
// For Microsoft Visual use specific types as long long is not supported
232+
#if defined(_MSC_VER) // Microsoft Visual Studio
233+
typedef __int64 Int64;
234+
typedef unsigned __int64 UInt64;
235+
#else // if defined(_MSC_VER) // Other platforms, use long long
236+
typedef long long int Int64;
237+
typedef unsigned long long int UInt64;
238+
#endif // if defined(_MSC_VER)
239+
typedef Int64 LargestInt;
240+
typedef UInt64 LargestUInt;
241+
#define JSON_HAS_INT64
242+
#endif // if defined(JSON_NO_INT64)
243+
#if JSONCPP_USING_SECURE_MEMORY
244+
#define JSONCPP_STRING std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >
245+
#define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
246+
#define JSONCPP_OSTREAM std::basic_ostream<char, std::char_traits<char>>
247+
#define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
248+
#define JSONCPP_ISTREAM std::istream
249+
#else
250+
#define JSONCPP_STRING std::string
251+
#define JSONCPP_OSTRINGSTREAM std::ostringstream
252+
#define JSONCPP_OSTREAM std::ostream
253+
#define JSONCPP_ISTRINGSTREAM std::istringstream
254+
#define JSONCPP_ISTREAM std::istream
255+
#endif // if JSONCPP_USING_SECURE_MEMORY
256+
} // end namespace Json
257+
258+
#endif // JSON_CONFIG_H_INCLUDED
259+
260+
// //////////////////////////////////////////////////////////////////////
261+
// End of content of file: include/json/config.h
262+
// //////////////////////////////////////////////////////////////////////
263+
264+
265+
266+
267+
268+
269+
// //////////////////////////////////////////////////////////////////////
270+
// Beginning of content of file: include/json/forwards.h
271+
// //////////////////////////////////////////////////////////////////////
272+
273+
// Copyright 2007-2010 Baptiste Lepilleur
274+
// Distributed under MIT license, or public domain if desired and
275+
// recognized in your jurisdiction.
276+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
277+
278+
#ifndef JSON_FORWARDS_H_INCLUDED
279+
#define JSON_FORWARDS_H_INCLUDED
280+
281+
#if !defined(JSON_IS_AMALGAMATION)
282+
#include "config.h"
283+
#endif // if !defined(JSON_IS_AMALGAMATION)
284+
285+
namespace Json {
286+
287+
// writer.h
288+
class FastWriter;
289+
class StyledWriter;
290+
291+
// reader.h
292+
class Reader;
293+
294+
// features.h
295+
class Features;
296+
297+
// value.h
298+
typedef unsigned int ArrayIndex;
299+
class StaticString;
300+
class Path;
301+
class PathArgument;
302+
class Value;
303+
class ValueIteratorBase;
304+
class ValueIterator;
305+
class ValueConstIterator;
306+
307+
} // namespace Json
308+
309+
#endif // JSON_FORWARDS_H_INCLUDED
310+
311+
// //////////////////////////////////////////////////////////////////////
312+
// End of content of file: include/json/forwards.h
313+
// //////////////////////////////////////////////////////////////////////
314+
315+
316+
317+
318+
319+
#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED

0 commit comments

Comments
 (0)