Clean up ripple_json module and remove unnecessary includes

This commit is contained in:
Vinnie Falco
2013-05-25 12:46:03 -07:00
parent ce66f950cf
commit 45d706943b
11 changed files with 57 additions and 86 deletions

View File

@@ -1,9 +1,6 @@
#ifndef JSONCPP_BATCHALLOCATOR_H_INCLUDED
# define JSONCPP_BATCHALLOCATOR_H_INCLUDED
# include <stdlib.h>
# include <assert.h>
# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
namespace Json {

View File

@@ -1,8 +1,6 @@
#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
#define CPPTL_JSON_FEATURES_H_INCLUDED
#include "json_forwards.h"
namespace Json {
/** \brief Configuration passed to reader and writer.

View File

@@ -1,7 +1,5 @@
#ifndef JSON_FORWARDS_H_INCLUDED
# define JSON_FORWARDS_H_INCLUDED
# include "json_config.h"
#define JSON_FORWARDS_H_INCLUDED
namespace Json {

View File

@@ -1,18 +1,3 @@
#include "json_reader.h"
#include "json_value.h"
#include <utility>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <iostream>
#include <stdexcept>
#if _MSC_VER >= 1400 // VC++ 8.0
#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
#endif
namespace Json {
// Implementation of class Features

View File

@@ -1,14 +1,6 @@
#ifndef CPPTL_JSON_READER_H_INCLUDED
# define CPPTL_JSON_READER_H_INCLUDED
#include "json_features.h"
#include "json_value.h"
#include <deque>
#include <stack>
#include <string>
#include <iostream>
namespace Json {
/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a Value.

View File

@@ -1,24 +1,3 @@
#include <iostream>
#include "json_value.h"
#include "json_writer.h"
#include <utility>
#include <stdexcept>
#include <cstring>
#include <cassert>
#ifdef JSON_USE_CPPTL
# include <cpptl/conststring.h>
#endif
#include <cstddef> // size_t
#include <boost/lexical_cast.hpp>
#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
# include "json_batchallocator.h"
#endif // #ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
#define JSON_ASSERT_UNREACHABLE assert( false )
#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
namespace Json {

View File

@@ -1,20 +1,6 @@
#ifndef CPPTL_JSON_H_INCLUDED
# define CPPTL_JSON_H_INCLUDED
#include "json_forwards.h"
#include <string>
#include <vector>
#ifndef JSON_USE_CPPTL_SMALLMAP
# include <map>
#else
# include <cpptl/smallmap.h>
#endif
#ifdef JSON_USE_CPPTL
# include <cpptl/forwards.h>
#endif
/** \brief JSON (JavaScript Object Notation).
*/
namespace Json {

View File

@@ -1,16 +1,3 @@
#include <utility>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <sstream>
#include <iomanip>
#include "json_writer.h"
#if _MSC_VER >= 1400 // VC++ 8.0
#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
#endif
namespace Json {

View File

@@ -1,12 +1,6 @@
#ifndef JSON_WRITER_H_INCLUDED
# define JSON_WRITER_H_INCLUDED
# include "json_value.h"
# include <vector>
# include <string>
# include <iostream>
namespace Json {
class Value;

View File

@@ -24,6 +24,38 @@
#include "ripple_json.h"
// VFALCO: TODO Remove unneeded includes
#include <cstddef>
//#include <cstdio>
//#include <cstring>
#include <iomanip>
//#include <iostream>
//#include <sstream>
//#include <stdexcept>
//#include <stdio.h>
//#include <string.h>
//#include <utility>
#ifdef JSON_USE_CPPTL
# include <cpptl/conststring.h>
#endif
// VFALCO: TODO, eliminate this boost dependency
#include <boost/lexical_cast.hpp>
#ifndef JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
#include "json/json_batchallocator.h"
#endif
#define JSON_ASSERT_UNREACHABLE assert( false )
#define JSON_ASSERT( condition ) assert( condition ); // @todo <= change this into an exception throw
#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) throw std::runtime_error( message );
//#if _MSC_VER >= 1400 // VC++ 8.0
//#pragma warning( disable : 4996 ) // disable warning about strdup being deprecated.
//#endif
#include "json/json_reader.cpp"
#include "json/json_value.cpp"
#include "json/json_writer.cpp"

View File

@@ -32,8 +32,31 @@
#ifndef RIPPLE_JSON_H
#define RIPPLE_JSON_H
// VFALCO: TODO Remove unneeded includes
#include <cassert>
//#include <cstdlib>
#include <deque>
//#include <iostream>
#include <stack>
//#include <string>
#include <vector>
// Needed before these cpptl includes
#include "json/json_config.h"
#ifndef JSON_USE_CPPTL_SMALLMAP
# include <map>
#else
# include <cpptl/smallmap.h>
#endif
#ifdef JSON_USE_CPPTL
# include <cpptl/forwards.h>
#endif
#include "json/json_forwards.h"
#include "json/json_features.h"
#include "json/json_value.h"
#include "json/json_reader.h"
#include "json/json_writer.h"
#include "json/json_value.h"
#endif