Skip to content

Commit 7b0abcc

Browse files
author
穆永刚
committed
add for android
1 parent bc9e4dc commit 7b0abcc

7 files changed

Lines changed: 8065 additions & 4 deletions

File tree

android/jni/Android.mk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#-------------------------------
2+
# Author:blueberry
3+
# -----------------------------
4+
5+
LOCAL_PATH:=$(call my-dir)
6+
include $(CLEAR_VARS)
7+
LOCAL_CPPFLAGS+=-DJSONCPP_NO_LOCALE_SUPPORT
8+
LOCAL_MODULE:=jsoncpp
9+
LOCAL_SRC_FILES:=jsoncpp.cpp
10+
LOCAL_C_INCLUDES:=$(LOCAL_PATH)/json
11+
include $(BUILD_SHARED_LIBRARY)

android/jni/Application.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
APP_STL:=gnustl_static
2+
3+
APP_CPPFLAGS:=-frtti -fexceptions -std=c++11
4+
APP_ABI:=all
5+
NDK_TOOLCHAIN_VERSION:=4.9
6+
APP_PLATFORM:=android-16

android/jni/json/json-forwards.h

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

0 commit comments

Comments
 (0)