Skip to content

Commit 7469f1d

Browse files
committed
JsonCpp is now licensed under MIT license, or public domain if desired and recognized in your jurisdiction.
1 parent 201fb2c commit 7469f1d

26 files changed

+396
-132
lines changed

Diff for: LICENSE

+57-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,57 @@
1-
The json-cpp library and this documentation are in Public Domain.
1+
This is the LICENSE file for JsonCpp, a C++ library implementing a
2+
JSON format reader and writer.
3+
4+
Author: Baptiste Lepilleur
5+
6+
The license for this library's code is as follows:
7+
8+
- If the code is used in a jurisdiction where Public Domain
9+
property is regonized, then this code may be considered to be
10+
in the Public Domain. Its author expressly disclaims copyright
11+
in jurisdictions where such a disclaimer is allowed.
12+
13+
- If the code is used in a jurisdiction which does not recognize
14+
Public Domain, the code must be used in terms with the MIT license,
15+
as described clearly and concisely at:
16+
17+
http://en.wikipedia.org/wiki/MIT_License
18+
19+
and reproduced in full below.
20+
21+
- If the code is used in a jurisdiction which recognizes Public
22+
Domain, the user may instead use the code under the terms of the
23+
MIT license.
24+
25+
The MIT licensing terms follow:
26+
27+
========================================================================
28+
Copyright (c) 2007-2010 Baptiste Lepilleur
29+
30+
Permission is hereby granted, free of charge, to any person
31+
obtaining a copy of this software and associated documentation
32+
files (the "Software"), to deal in the Software without
33+
restriction, including without limitation the rights to use, copy,
34+
modify, merge, publish, distribute, sublicense, and/or sell copies
35+
of the Software, and to permit persons to whom the Software is
36+
furnished to do so, subject to the following conditions:
37+
38+
The above copyright notice and this permission notice shall be
39+
included in all copies or substantial portions of the Software.
40+
41+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
42+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
43+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
44+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
45+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
46+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
47+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
48+
SOFTWARE.
49+
========================================================================
50+
(END LICENSE TEXT)
51+
52+
The MIT license is compatible with both the GPL and commercial
53+
software, affording one all of the rights of Public Domain with the
54+
minor nuisance of being required to keep the above copyright notice
55+
and license text in the source code. Note also that by accepting the
56+
Public Domain "license" you can re-license your copy using whatever
57+
license you like.

Diff for: NEWS.txt

+5
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@
3232

3333
- The type Json::ArrayIndex is used for indexes of a JSON value array. It
3434
is an unsigned int (typically 32 bits).
35+
36+
* License
37+
38+
- See file LICENSE for details. Basically JsonCpp is now licensed under
39+
MIT license, or public domain if desired and recognized in your jurisdiction.

Diff for: README.txt

+6
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,9 @@ Below is a short description of the content of each file:
120120
jsontest.exe from reading test_complex_01.rewrite.
121121
test_complex_01.process-output: jsontest.exe output, typically useful to
122122
understand parsing error.
123+
124+
* License
125+
=======
126+
127+
See file LICENSE for details. Basically JsonCpp is licensed under
128+
MIT license, or public domain if desired and recognized in your jurisdiction.

Diff for: devtools/licenseupdater.py

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
"""Updates the license text in source file.
2+
"""
3+
4+
# An existing license is found if the file starts with the string below,
5+
# and ends with the first blank line.
6+
LICENSE_BEGIN = "// Copyright "
7+
8+
BRIEF_LICENSE = LICENSE_BEGIN + """2007-2010 Baptiste Lepilleur
9+
// Distributed under MIT license, or public domain if desired and
10+
// recognized in your jurisdiction.
11+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
12+
13+
""".replace('\r\n','\n')
14+
15+
def update_license( path, dry_run, show_diff ):
16+
"""Update the license statement in the specified file.
17+
Parameters:
18+
path: path of the C++ source file to update.
19+
dry_run: if True, just print the path of the file that would be updated,
20+
but don't change it.
21+
show_diff: if True, print the path of the file that would be modified,
22+
as well as the change made to the file.
23+
"""
24+
with open( path, 'rt' ) as fin:
25+
original_text = fin.read().replace('\r\n','\n')
26+
newline = fin.newlines and fin.newlines[0] or '\n'
27+
if not original_text.startswith( LICENSE_BEGIN ):
28+
# No existing license found => prepend it
29+
new_text = BRIEF_LICENSE + original_text
30+
else:
31+
license_end_index = original_text.index( '\n\n' ) # search first blank line
32+
new_text = BRIEF_LICENSE + original_text[license_end_index+2:]
33+
if original_text != new_text:
34+
if not dry_run:
35+
with open( path, 'wb' ) as fout:
36+
fout.write( new_text.replace('\n', newline ) )
37+
print 'Updated', path
38+
if show_diff:
39+
import difflib
40+
print '\n'.join( difflib.unified_diff( original_text.split('\n'),
41+
new_text.split('\n') ) )
42+
return True
43+
return False
44+
45+
def update_license_in_source_directories( source_dirs, dry_run, show_diff ):
46+
"""Updates license text in C++ source files found in directory source_dirs.
47+
Parameters:
48+
source_dirs: list of directory to scan for C++ sources. Directories are
49+
scanned recursively.
50+
dry_run: if True, just print the path of the file that would be updated,
51+
but don't change it.
52+
show_diff: if True, print the path of the file that would be modified,
53+
as well as the change made to the file.
54+
"""
55+
from devtools import antglob
56+
prune_dirs = antglob.prune_dirs + 'scons-local* ./build* ./libs ./dist'
57+
for source_dir in source_dirs:
58+
cpp_sources = antglob.glob( source_dir,
59+
includes = '''**/*.h **/*.cpp **/*.inl''',
60+
prune_dirs = prune_dirs )
61+
for source in cpp_sources:
62+
update_license( source, dry_run, show_diff )
63+
64+
def main():
65+
usage = """%prog DIR [DIR2...]
66+
Updates license text in sources of the project in source files found
67+
in the directory specified on the command-line.
68+
69+
Example of call:
70+
python devtools\licenseupdater.py include src -n --diff
71+
=> Show change that would be made to the sources.
72+
73+
python devtools\licenseupdater.py include src
74+
=> Update license statement on all sources in directories include/ and src/.
75+
"""
76+
from optparse import OptionParser
77+
parser = OptionParser(usage=usage)
78+
parser.allow_interspersed_args = False
79+
parser.add_option('-n', '--dry-run', dest="dry_run", action='store_true', default=False,
80+
help="""Only show what files are updated, do not update the files""")
81+
parser.add_option('--diff', dest="show_diff", action='store_true', default=False,
82+
help="""On update, show change made to the file.""")
83+
parser.enable_interspersed_args()
84+
options, args = parser.parse_args()
85+
update_license_in_source_directories( args, options.dry_run, options.show_diff )
86+
print 'Done'
87+
88+
if __name__ == '__main__':
89+
import sys
90+
import os.path
91+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
92+
main()
93+

Diff for: doc/jsoncpp.dox

+4-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ Permanent link to the latest revision of the file in subversion:
117117
- <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>.
118118

119119
\section _license License
120-
The json-cpp library and this documentation are in Public Domain.
120+
See file <a HREF="LICENSE">LICENSE</a> in the top-directory of the project.
121+
122+
Basically JsonCpp is licensed under MIT license, or public domain if desired
123+
and recognized in your jurisdiction.
121124

122125
\author Baptiste Lepilleur <[email protected]>
123126
*/

Diff for: doxybuild.py

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def yesno( bool ):
127127
tarball_sources = [
128128
output_dir,
129129
'README.txt',
130+
'LICENSE',
130131
'NEWS.txt',
131132
'version'
132133
]

Diff for: include/json/autolink.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef JSON_AUTOLINK_H_INCLUDED
27
# define JSON_AUTOLINK_H_INCLUDED
38

Diff for: include/json/config.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef JSON_CONFIG_H_INCLUDED
27
# define JSON_CONFIG_H_INCLUDED
38

Diff for: include/json/features.h

+47-42
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,47 @@
1-
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
2-
# define CPPTL_JSON_FEATURES_H_INCLUDED
3-
4-
# include "forwards.h"
5-
6-
namespace Json {
7-
8-
/** \brief Configuration passed to reader and writer.
9-
* This configuration object can be used to force the Reader or Writer
10-
* to behave in a standard conforming way.
11-
*/
12-
class JSON_API Features
13-
{
14-
public:
15-
/** \brief A configuration that allows all features and assumes all strings are UTF-8.
16-
* - C & C++ comments are allowed
17-
* - Root object can be any JSON value
18-
* - Assumes Value strings are encoded in UTF-8
19-
*/
20-
static Features all();
21-
22-
/** \brief A configuration that is strictly compatible with the JSON specification.
23-
* - Comments are forbidden.
24-
* - Root object must be either an array or an object value.
25-
* - Assumes Value strings are encoded in UTF-8
26-
*/
27-
static Features strictMode();
28-
29-
/** \brief Initialize the configuration like JsonConfig::allFeatures;
30-
*/
31-
Features();
32-
33-
/// \c true if comments are allowed. Default: \c true.
34-
bool allowComments_;
35-
36-
/// \c true if root must be either an array or an object value. Default: \c false.
37-
bool strictRoot_;
38-
};
39-
40-
} // namespace Json
41-
42-
#endif // CPPTL_JSON_FEATURES_H_INCLUDED
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
6+
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
7+
# define CPPTL_JSON_FEATURES_H_INCLUDED
8+
9+
# include "forwards.h"
10+
11+
namespace Json {
12+
13+
/** \brief Configuration passed to reader and writer.
14+
* This configuration object can be used to force the Reader or Writer
15+
* to behave in a standard conforming way.
16+
*/
17+
class JSON_API Features
18+
{
19+
public:
20+
/** \brief A configuration that allows all features and assumes all strings are UTF-8.
21+
* - C & C++ comments are allowed
22+
* - Root object can be any JSON value
23+
* - Assumes Value strings are encoded in UTF-8
24+
*/
25+
static Features all();
26+
27+
/** \brief A configuration that is strictly compatible with the JSON specification.
28+
* - Comments are forbidden.
29+
* - Root object must be either an array or an object value.
30+
* - Assumes Value strings are encoded in UTF-8
31+
*/
32+
static Features strictMode();
33+
34+
/** \brief Initialize the configuration like JsonConfig::allFeatures;
35+
*/
36+
Features();
37+
38+
/// \c true if comments are allowed. Default: \c true.
39+
bool allowComments_;
40+
41+
/// \c true if root must be either an array or an object value. Default: \c false.
42+
bool strictRoot_;
43+
};
44+
45+
} // namespace Json
46+
47+
#endif // CPPTL_JSON_FEATURES_H_INCLUDED

Diff for: include/json/forwards.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef JSON_FORWARDS_H_INCLUDED
27
# define JSON_FORWARDS_H_INCLUDED
38

Diff for: include/json/json.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef JSON_JSON_H_INCLUDED
27
# define JSON_JSON_H_INCLUDED
38

Diff for: include/json/reader.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef CPPTL_JSON_READER_H_INCLUDED
27
# define CPPTL_JSON_READER_H_INCLUDED
38

Diff for: include/json/value.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef CPPTL_JSON_H_INCLUDED
27
# define CPPTL_JSON_H_INCLUDED
38

Diff for: include/json/writer.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef JSON_WRITER_H_INCLUDED
27
# define JSON_WRITER_H_INCLUDED
38

Diff for: src/jsontestrunner/main.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#include <json/json.h>
27
#include <algorithm> // sort
38
#include <stdio.h>

Diff for: src/lib_json/json_batchallocator.h

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED
27
# define JSONCPP_BATCHALLOCATOR_H_INCLUDED
38

Diff for: src/lib_json/json_internalarray.inl

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
// included by json_value.cpp
27
// everything is within Json namespace
38

Diff for: src/lib_json/json_internalmap.inl

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
// included by json_value.cpp
27
// everything is within Json namespace
38

Diff for: src/lib_json/json_reader.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
// Copyright 2007-2010 Baptiste Lepilleur
2+
// Distributed under MIT license, or public domain if desired and
3+
// recognized in your jurisdiction.
4+
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
5+
16
#include <json/reader.h>
27
#include <json/value.h>
38
#include "json_tool.h"

0 commit comments

Comments
 (0)