Added support for amalgated source and header generation (a la sqlite). Refer to README.txt section "Generating amalgated source and header" for detail.

The amalgated sources are generated by concatenating JsonCpp source in the correct order and defining macro JSON_IS_AMALGATED to prevent inclusion of other headers. Sources and header has been modified to prevent any inclusion when this macro is defined.

The script amalgate.py handle the generation.
This commit is contained in:
Baptiste Lepilleur
2011-05-01 20:13:40 +00:00
parent 91923f2cbc
commit 64e40aafe5
14 changed files with 82 additions and 18 deletions

View File

@@ -28,6 +28,12 @@
/// instead of C assert macro.
# define JSON_USE_EXCEPTION 1
/// If defined, indicates that the source file is amalgated
/// to prevent private header inclusion.
/// Remarks: it is automatically defined in the generated amalgated header.
// #define JSON_IS_AMALGATED
# ifdef JSON_IN_CPPTL
# include <cpptl/config.h>
# ifndef JSON_USE_CPPTL

View File

@@ -6,7 +6,9 @@
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
# define CPPTL_JSON_FEATURES_H_INCLUDED
#if !defined(JSON_IS_AMALGATED)
# include "forwards.h"
#endif // if !defined(JSON_IS_AMALGATED)
namespace Json {

View File

@@ -6,7 +6,9 @@
#ifndef JSON_FORWARDS_H_INCLUDED
# define JSON_FORWARDS_H_INCLUDED
#if !defined(JSON_IS_AMALGATED)
# include "config.h"
#endif // if !defined(JSON_IS_AMALGATED)
namespace Json {

View File

@@ -6,8 +6,10 @@
#ifndef CPPTL_JSON_READER_H_INCLUDED
# define CPPTL_JSON_READER_H_INCLUDED
#if !defined(JSON_IS_AMALGATED)
# include "features.h"
# include "value.h"
#endif // if !defined(JSON_IS_AMALGATED)
# include <deque>
# include <stack>
# include <string>

View File

@@ -6,7 +6,9 @@
#ifndef CPPTL_JSON_H_INCLUDED
# define CPPTL_JSON_H_INCLUDED
#if !defined(JSON_IS_AMALGATED)
# include "forwards.h"
#endif // if !defined(JSON_IS_AMALGATED)
# include <string>
# include <vector>

View File

@@ -6,7 +6,9 @@
#ifndef JSON_WRITER_H_INCLUDED
# define JSON_WRITER_H_INCLUDED
#if !defined(JSON_IS_AMALGATED)
# include "value.h"
#endif // if !defined(JSON_IS_AMALGATED)
# include <vector>
# include <string>
# include <iostream>