mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-04-25 09:25:56 +02:00
Fixed typo: amalga*ma*te. Replaced macro JSON_IS_AMALGATED with JSON_IS_AMALGAMATION
This commit is contained in:
parent
1837a1c508
commit
eadc478e50
4
NEWS.txt
4
NEWS.txt
@ -13,8 +13,8 @@
|
|||||||
Notes: you need to setup the environment by running vcvars32.bat
|
Notes: you need to setup the environment by running vcvars32.bat
|
||||||
(e.g. MSVC 2008 command prompt in start menu) before running scons.
|
(e.g. MSVC 2008 command prompt in start menu) before running scons.
|
||||||
|
|
||||||
- Added support for amalgated source and header generation (a la sqlite).
|
- Added support for amalgamated source and header generation (a la sqlite).
|
||||||
Refer to README.txt section "Generating amalgated source and header"
|
Refer to README.txt section "Generating amalgamated source and header"
|
||||||
for detail.
|
for detail.
|
||||||
|
|
||||||
* Value
|
* Value
|
||||||
|
16
README.txt
16
README.txt
@ -90,30 +90,30 @@ Notes that the documentation is also available for download as a tarball.
|
|||||||
The documentation of the latest release is available online at:
|
The documentation of the latest release is available online at:
|
||||||
http://jsoncpp.sourceforge.net/
|
http://jsoncpp.sourceforge.net/
|
||||||
|
|
||||||
* Generating amalgated source and header
|
* Generating amalgamated source and header
|
||||||
======================================
|
========================================
|
||||||
|
|
||||||
JsonCpp is provided with a script to generate a single header and a single
|
JsonCpp is provided with a script to generate a single header and a single
|
||||||
source file to ease inclusion in an existing project.
|
source file to ease inclusion in an existing project.
|
||||||
|
|
||||||
The amalgated source can be generated at any time by running the following
|
The amalgamated source can be generated at any time by running the following
|
||||||
command from the top-directory (requires python 2.6):
|
command from the top-directory (requires python 2.6):
|
||||||
|
|
||||||
python amalgate.py
|
python amalgamate.py
|
||||||
|
|
||||||
It is possible to specify header name. See -h options for detail. By default,
|
It is possible to specify header name. See -h options for detail. By default,
|
||||||
the following files are generated:
|
the following files are generated:
|
||||||
- dist/jsoncpp.cpp: source file that need to be added to your project
|
- dist/jsoncpp.cpp: source file that need to be added to your project
|
||||||
- dist/json/json.h: header file corresponding to use in your project. It is
|
- dist/json/json.h: header file corresponding to use in your project. It is
|
||||||
equivalent to including json/json.h in non-amalgated source. This header
|
equivalent to including json/json.h in non-amalgamated source. This header
|
||||||
only depends on standard headers.
|
only depends on standard headers.
|
||||||
- dist/json/json-forwards.h: header the provides forward declaration
|
- dist/json/json-forwards.h: header the provides forward declaration
|
||||||
of all JsonCpp types. This typically what should be included in headers to
|
of all JsonCpp types. This typically what should be included in headers to
|
||||||
speed-up compilation.
|
speed-up compilation.
|
||||||
|
|
||||||
The amalgated sources are generated by concatenating JsonCpp source in the
|
The amalgamated sources are generated by concatenating JsonCpp source in the
|
||||||
correct order and defining macro JSON_IS_AMALGATED to prevent inclusion of
|
correct order and defining macro JSON_IS_AMALGAMATION to prevent inclusion
|
||||||
other headers.
|
of other headers.
|
||||||
|
|
||||||
* Using json-cpp in your project:
|
* Using json-cpp in your project:
|
||||||
===============================
|
===============================
|
||||||
|
@ -9,7 +9,7 @@ import os
|
|||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
class AmalagatedFile:
|
class AmalgamationFile:
|
||||||
def __init__( self, top_dir ):
|
def __init__( self, top_dir ):
|
||||||
self.top_dir = top_dir
|
self.top_dir = top_dir
|
||||||
self.blocks = []
|
self.blocks = []
|
||||||
@ -47,7 +47,7 @@ class AmalagatedFile:
|
|||||||
f.write( self.get_value() )
|
f.write( self.get_value() )
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
def amalgate_source( source_top_dir=None,
|
def amalgamate_source( source_top_dir=None,
|
||||||
target_source_path=None,
|
target_source_path=None,
|
||||||
header_include_path=None ):
|
header_include_path=None ):
|
||||||
"""Produces amalgated source.
|
"""Produces amalgated source.
|
||||||
@ -57,7 +57,7 @@ def amalgate_source( source_top_dir=None,
|
|||||||
header_include_path: generated header path relative to target_source_path.
|
header_include_path: generated header path relative to target_source_path.
|
||||||
"""
|
"""
|
||||||
print 'Amalgating header...'
|
print 'Amalgating header...'
|
||||||
header = AmalagatedFile( source_top_dir )
|
header = AmalgamationFile( source_top_dir )
|
||||||
header.add_text( '/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/).' )
|
header.add_text( '/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/).' )
|
||||||
header.add_text( '/// It is intented to be used with #include <%s>' % header_include_path )
|
header.add_text( '/// It is intented to be used with #include <%s>' % header_include_path )
|
||||||
header.add_file( 'LICENSE', wrap_in_comment=True )
|
header.add_file( 'LICENSE', wrap_in_comment=True )
|
||||||
@ -81,7 +81,7 @@ def amalgate_source( source_top_dir=None,
|
|||||||
base, ext = os.path.splitext( header_include_path )
|
base, ext = os.path.splitext( header_include_path )
|
||||||
forward_header_include_path = base + '-forwards' + ext
|
forward_header_include_path = base + '-forwards' + ext
|
||||||
print 'Amalgating forward header...'
|
print 'Amalgating forward header...'
|
||||||
header = AmalagatedFile( source_top_dir )
|
header = AmalgamationFile( source_top_dir )
|
||||||
header.add_text( '/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/).' )
|
header.add_text( '/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/).' )
|
||||||
header.add_text( '/// It is intented to be used with #include <%s>' % forward_header_include_path )
|
header.add_text( '/// It is intented to be used with #include <%s>' % forward_header_include_path )
|
||||||
header.add_text( '/// This header provides forward declaration for all JsonCpp types.' )
|
header.add_text( '/// This header provides forward declaration for all JsonCpp types.' )
|
||||||
@ -101,7 +101,7 @@ def amalgate_source( source_top_dir=None,
|
|||||||
header.write_to( target_forward_header_path )
|
header.write_to( target_forward_header_path )
|
||||||
|
|
||||||
print 'Amalgating source...'
|
print 'Amalgating source...'
|
||||||
source = AmalagatedFile( source_top_dir )
|
source = AmalgamationFile( source_top_dir )
|
||||||
source.add_text( '/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/).' )
|
source.add_text( '/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/).' )
|
||||||
source.add_text( '/// It is intented to be used with #include <%s>' % header_include_path )
|
source.add_text( '/// It is intented to be used with #include <%s>' % header_include_path )
|
||||||
source.add_file( 'LICENSE', wrap_in_comment=True )
|
source.add_file( 'LICENSE', wrap_in_comment=True )
|
||||||
@ -134,7 +134,7 @@ Generate a single amalgated source and header file from the sources.
|
|||||||
parser.enable_interspersed_args()
|
parser.enable_interspersed_args()
|
||||||
options, args = parser.parse_args()
|
options, args = parser.parse_args()
|
||||||
|
|
||||||
msg = amalgate_source( source_top_dir=options.top_dir,
|
msg = amalgamate_source( source_top_dir=options.top_dir,
|
||||||
target_source_path=options.target_source_path,
|
target_source_path=options.target_source_path,
|
||||||
header_include_path=options.header_include_path )
|
header_include_path=options.header_include_path )
|
||||||
if msg:
|
if msg:
|
@ -31,7 +31,7 @@
|
|||||||
/// If defined, indicates that the source file is amalgated
|
/// If defined, indicates that the source file is amalgated
|
||||||
/// to prevent private header inclusion.
|
/// to prevent private header inclusion.
|
||||||
/// Remarks: it is automatically defined in the generated amalgated header.
|
/// Remarks: it is automatically defined in the generated amalgated header.
|
||||||
// #define JSON_IS_AMALGATED
|
// #define JSON_IS_AMALGAMATION
|
||||||
|
|
||||||
|
|
||||||
# ifdef JSON_IN_CPPTL
|
# ifdef JSON_IN_CPPTL
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
|
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
|
||||||
# define CPPTL_JSON_FEATURES_H_INCLUDED
|
# define CPPTL_JSON_FEATURES_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include "forwards.h"
|
# include "forwards.h"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
|
|
||||||
namespace Json {
|
namespace Json {
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
#ifndef JSON_FORWARDS_H_INCLUDED
|
#ifndef JSON_FORWARDS_H_INCLUDED
|
||||||
# define JSON_FORWARDS_H_INCLUDED
|
# define JSON_FORWARDS_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
|
|
||||||
namespace Json {
|
namespace Json {
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@
|
|||||||
#ifndef CPPTL_JSON_READER_H_INCLUDED
|
#ifndef CPPTL_JSON_READER_H_INCLUDED
|
||||||
# define CPPTL_JSON_READER_H_INCLUDED
|
# define CPPTL_JSON_READER_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include "features.h"
|
# include "features.h"
|
||||||
# include "value.h"
|
# include "value.h"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include <deque>
|
# include <deque>
|
||||||
# include <stack>
|
# include <stack>
|
||||||
# include <string>
|
# include <string>
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
#ifndef CPPTL_JSON_H_INCLUDED
|
#ifndef CPPTL_JSON_H_INCLUDED
|
||||||
# define CPPTL_JSON_H_INCLUDED
|
# define CPPTL_JSON_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include "forwards.h"
|
# include "forwards.h"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include <string>
|
# include <string>
|
||||||
# include <vector>
|
# include <vector>
|
||||||
|
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
#ifndef JSON_WRITER_H_INCLUDED
|
#ifndef JSON_WRITER_H_INCLUDED
|
||||||
# define JSON_WRITER_H_INCLUDED
|
# define JSON_WRITER_H_INCLUDED
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include "value.h"
|
# include "value.h"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include <vector>
|
# include <vector>
|
||||||
# include <string>
|
# include <string>
|
||||||
# include <iostream>
|
# include <iostream>
|
||||||
|
@ -23,7 +23,7 @@ import tempfile
|
|||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
from devtools import antglob, fixeol, tarball
|
from devtools import antglob, fixeol, tarball
|
||||||
import amalgate
|
import amalgamate
|
||||||
|
|
||||||
SVN_ROOT = 'https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/'
|
SVN_ROOT = 'https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/'
|
||||||
SVN_TAG_ROOT = SVN_ROOT + 'tags/jsoncpp'
|
SVN_TAG_ROOT = SVN_ROOT + 'tags/jsoncpp'
|
||||||
@ -323,13 +323,13 @@ Warning: --force should only be used when developping/testing the release script
|
|||||||
print 'Generating source tarball to', source_tarball_path
|
print 'Generating source tarball to', source_tarball_path
|
||||||
tarball.make_tarball( source_tarball_path, [export_dir], export_dir, prefix_dir=source_dir )
|
tarball.make_tarball( source_tarball_path, [export_dir], export_dir, prefix_dir=source_dir )
|
||||||
|
|
||||||
amalgated_tarball_path = 'dist/%s-amalgated.tar.gz' % source_dir
|
amalgamation_tarball_path = 'dist/%s-amalgamation.tar.gz' % source_dir
|
||||||
print 'Generating amalgated source tarball to', amalgated_tarball_path
|
print 'Generating amalgamation source tarball to', amalgamation_tarball_path
|
||||||
amalgated_dir = 'dist/amalgated'
|
amalgamation_dir = 'dist/amalgamation'
|
||||||
amalgate.amalgate_source( export_dir, '%s/jsoncpp.cpp' % amalgated_dir, 'json/json.h' )
|
amalgamate.amalgamate_source( export_dir, '%s/jsoncpp.cpp' % amalgamation_dir, 'json/json.h' )
|
||||||
amalgated_source_dir = 'jsoncpp-src-amalgated' + release_version
|
amalgamation_source_dir = 'jsoncpp-src-amalgamation' + release_version
|
||||||
tarball.make_tarball( amalgated_tarball_path, [amalgated_dir],
|
tarball.make_tarball( amalgamation_tarball_path, [amalgamation_dir],
|
||||||
amalgated_dir, prefix_dir=amalgated_source_dir )
|
amalgamation_dir, prefix_dir=amalgamation_source_dir )
|
||||||
|
|
||||||
# Decompress source tarball, download and install scons-local
|
# Decompress source tarball, download and install scons-local
|
||||||
distcheck_dir = 'dist/distcheck'
|
distcheck_dir = 'dist/distcheck'
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
// recognized in your jurisdiction.
|
// recognized in your jurisdiction.
|
||||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include <json/reader.h>
|
# include <json/reader.h>
|
||||||
# include <json/value.h>
|
# include <json/value.h>
|
||||||
# include "json_tool.h"
|
# include "json_tool.h"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
// recognized in your jurisdiction.
|
// recognized in your jurisdiction.
|
||||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include <json/value.h>
|
# include <json/value.h>
|
||||||
# include <json/writer.h>
|
# include <json/writer.h>
|
||||||
# ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
|
# ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
|
||||||
# include "json_batchallocator.h"
|
# include "json_batchallocator.h"
|
||||||
# endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
|
# endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -83,14 +83,14 @@ releaseStringValue( char *value )
|
|||||||
// //////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////
|
||||||
// //////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////
|
||||||
// //////////////////////////////////////////////////////////////////
|
// //////////////////////////////////////////////////////////////////
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# ifdef JSON_VALUE_USE_INTERNAL_MAP
|
# ifdef JSON_VALUE_USE_INTERNAL_MAP
|
||||||
# include "json_internalarray.inl"
|
# include "json_internalarray.inl"
|
||||||
# include "json_internalmap.inl"
|
# include "json_internalmap.inl"
|
||||||
# endif // JSON_VALUE_USE_INTERNAL_MAP
|
# endif // JSON_VALUE_USE_INTERNAL_MAP
|
||||||
|
|
||||||
# include "json_valueiterator.inl"
|
# include "json_valueiterator.inl"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
|
|
||||||
namespace Json {
|
namespace Json {
|
||||||
|
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
// recognized in your jurisdiction.
|
// recognized in your jurisdiction.
|
||||||
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
|
||||||
|
|
||||||
#if !defined(JSON_IS_AMALGATED)
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
# include <json/writer.h>
|
# include <json/writer.h>
|
||||||
# include "json_tool.h"
|
# include "json_tool.h"
|
||||||
#endif // if !defined(JSON_IS_AMALGATED)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user