From e256716da8402a913d5d109c38a33efda63b4eba Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 1 Sep 2013 09:34:42 -0700 Subject: [PATCH] Merge ripple_json to ripple_basics --- Builds/QtCreator/rippled.pro | 1 - Builds/VisualStudio2012/RippleD.vcxproj | 62 ++++----- .../VisualStudio2012/RippleD.vcxproj.filters | 123 ++++++++++-------- SConstruct | 1 - .../json/LICENSE | Bin .../json/json_autolink.h | 0 .../json/json_batchallocator.h | 0 .../json/json_config.h | 0 .../json/json_features.h | 0 .../json/json_forwards.h | 0 .../json/json_internalarray.inl | 0 .../json/json_internalmap.inl | 0 .../json/json_reader.cpp | 0 .../json/json_reader.h | 0 .../json/json_value.cpp | 0 .../json/json_value.h | 0 .../json/json_valueiterator.inl | 0 .../json/json_writer.cpp | 0 .../json/json_writer.h | 0 .../json/version | 0 modules/ripple_basics/ripple_basics.cpp | 44 ++++++- modules/ripple_basics/ripple_basics.h | 27 +++- .../system/ripple_StandardIncludes.h | 1 + modules/ripple_json/ripple_json.cpp | 39 ------ modules/ripple_json/ripple_json.h | 48 ------- 25 files changed, 162 insertions(+), 184 deletions(-) rename modules/{ripple_json => ripple_basics}/json/LICENSE (100%) rename modules/{ripple_json => ripple_basics}/json/json_autolink.h (100%) rename modules/{ripple_json => ripple_basics}/json/json_batchallocator.h (100%) rename modules/{ripple_json => ripple_basics}/json/json_config.h (100%) rename modules/{ripple_json => ripple_basics}/json/json_features.h (100%) rename modules/{ripple_json => ripple_basics}/json/json_forwards.h (100%) rename modules/{ripple_json => ripple_basics}/json/json_internalarray.inl (100%) rename modules/{ripple_json => ripple_basics}/json/json_internalmap.inl (100%) rename modules/{ripple_json => ripple_basics}/json/json_reader.cpp (100%) rename modules/{ripple_json => ripple_basics}/json/json_reader.h (100%) rename modules/{ripple_json => ripple_basics}/json/json_value.cpp (100%) rename modules/{ripple_json => ripple_basics}/json/json_value.h (100%) rename modules/{ripple_json => ripple_basics}/json/json_valueiterator.inl (100%) rename modules/{ripple_json => ripple_basics}/json/json_writer.cpp (100%) rename modules/{ripple_json => ripple_basics}/json/json_writer.h (100%) rename modules/{ripple_json => ripple_basics}/json/version (100%) delete mode 100644 modules/ripple_json/ripple_json.cpp delete mode 100644 modules/ripple_json/ripple_json.h diff --git a/Builds/QtCreator/rippled.pro b/Builds/QtCreator/rippled.pro index 881a780acd..0f27c786cc 100644 --- a/Builds/QtCreator/rippled.pro +++ b/Builds/QtCreator/rippled.pro @@ -80,7 +80,6 @@ SOURCES += \ ../../modules/ripple_client/ripple_client.cpp \ ../../modules/ripple_data/ripple_data.cpp \ ../../modules/ripple_hyperleveldb/ripple_hyperleveldb.cpp \ - ../../modules/ripple_json/ripple_json.cpp \ ../../modules/ripple_leveldb/ripple_leveldb.cpp \ ../../modules/ripple_mdb/ripple_mdb.c \ ../../modules/ripple_net/ripple_net.cpp \ diff --git a/Builds/VisualStudio2012/RippleD.vcxproj b/Builds/VisualStudio2012/RippleD.vcxproj index 05ad0ac20c..d3ab2c7e53 100644 --- a/Builds/VisualStudio2012/RippleD.vcxproj +++ b/Builds/VisualStudio2012/RippleD.vcxproj @@ -696,6 +696,24 @@ true true + + true + true + true + true + + + true + true + true + true + + + true + true + true + true + true @@ -959,25 +977,6 @@ - - true - true - true - true - - - true - true - true - true - - - true - true - true - true - - @@ -1482,6 +1481,14 @@ + + + + + + + + @@ -1547,15 +1554,6 @@ - - - - - - - - - @@ -1650,9 +1648,11 @@ $(RepoDir)\build\proto\%(Filename).pb.h;$(RepoDir)\build\proto\%(Filename).pb.cc $(RepoDir)\build\proto\%(Filename).pb.h;$(RepoDir)\build\proto\%(Filename).pb.cc - - - + + + + + diff --git a/Builds/VisualStudio2012/RippleD.vcxproj.filters b/Builds/VisualStudio2012/RippleD.vcxproj.filters index 200b3d846b..78b06af64d 100644 --- a/Builds/VisualStudio2012/RippleD.vcxproj.filters +++ b/Builds/VisualStudio2012/RippleD.vcxproj.filters @@ -25,9 +25,6 @@ {e0dd916d-72b2-46cd-840a-fb5e924a470a} - - {0d065d55-0a7b-480b-beee-67dad6ee6684} - {df861e00-baa6-43d4-bbbf-df61d66ee414} @@ -67,9 +64,6 @@ {a837f3ce-75b7-4e6c-b8b1-728b6a1216bd} - - {9d43b540-fdec-484d-a8bd-0dc65d3b0c55} - {99ac4d07-04a7-4ce3-96c7-b8ea578f1a61} @@ -160,6 +154,9 @@ {7c14e9df-6d8d-4ba3-b208-f89c1d0b6b30} + + {083291b1-1498-490e-9794-4319d21d5668} + @@ -306,18 +303,6 @@ [1] Ripple\ripple_data - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json - [1] Ripple\ripple_leveldb @@ -882,6 +867,21 @@ [1] Ripple\ripple_data\protocol + + [1] Ripple\ripple_app\rpc + + + [1] Ripple\ripple_app + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + @@ -1046,33 +1046,6 @@ [1] Ripple\ripple_data - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json - [1] Ripple\ripple_leveldb @@ -1679,6 +1652,42 @@ [1] Ripple\ripple_data\protocol + + [1] Ripple\ripple_app\rpc + + + [1] Ripple\ripple_core\functional + + + [1] Ripple\ripple_core\functional + + + [1] Ripple\ripple_app\main + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + @@ -1686,15 +1695,6 @@ - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - - - [1] Ripple\ripple_json\json - %28Notes%29 @@ -1713,6 +1713,21 @@ [2] Build + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + + + [1] Ripple\ripple_basics\json + diff --git a/SConstruct b/SConstruct index be4d64142c..934537d7b6 100644 --- a/SConstruct +++ b/SConstruct @@ -149,7 +149,6 @@ COMPILED_FILES.extend([ 'modules/ripple_core/ripple_core.cpp', 'modules/ripple_data/ripple_data.cpp', 'modules/ripple_hyperleveldb/ripple_hyperleveldb.cpp', - 'modules/ripple_json/ripple_json.cpp', 'modules/ripple_leveldb/ripple_leveldb.cpp', 'modules/ripple_mdb/ripple_mdb.c', 'modules/ripple_net/ripple_net.cpp', diff --git a/modules/ripple_json/json/LICENSE b/modules/ripple_basics/json/LICENSE similarity index 100% rename from modules/ripple_json/json/LICENSE rename to modules/ripple_basics/json/LICENSE diff --git a/modules/ripple_json/json/json_autolink.h b/modules/ripple_basics/json/json_autolink.h similarity index 100% rename from modules/ripple_json/json/json_autolink.h rename to modules/ripple_basics/json/json_autolink.h diff --git a/modules/ripple_json/json/json_batchallocator.h b/modules/ripple_basics/json/json_batchallocator.h similarity index 100% rename from modules/ripple_json/json/json_batchallocator.h rename to modules/ripple_basics/json/json_batchallocator.h diff --git a/modules/ripple_json/json/json_config.h b/modules/ripple_basics/json/json_config.h similarity index 100% rename from modules/ripple_json/json/json_config.h rename to modules/ripple_basics/json/json_config.h diff --git a/modules/ripple_json/json/json_features.h b/modules/ripple_basics/json/json_features.h similarity index 100% rename from modules/ripple_json/json/json_features.h rename to modules/ripple_basics/json/json_features.h diff --git a/modules/ripple_json/json/json_forwards.h b/modules/ripple_basics/json/json_forwards.h similarity index 100% rename from modules/ripple_json/json/json_forwards.h rename to modules/ripple_basics/json/json_forwards.h diff --git a/modules/ripple_json/json/json_internalarray.inl b/modules/ripple_basics/json/json_internalarray.inl similarity index 100% rename from modules/ripple_json/json/json_internalarray.inl rename to modules/ripple_basics/json/json_internalarray.inl diff --git a/modules/ripple_json/json/json_internalmap.inl b/modules/ripple_basics/json/json_internalmap.inl similarity index 100% rename from modules/ripple_json/json/json_internalmap.inl rename to modules/ripple_basics/json/json_internalmap.inl diff --git a/modules/ripple_json/json/json_reader.cpp b/modules/ripple_basics/json/json_reader.cpp similarity index 100% rename from modules/ripple_json/json/json_reader.cpp rename to modules/ripple_basics/json/json_reader.cpp diff --git a/modules/ripple_json/json/json_reader.h b/modules/ripple_basics/json/json_reader.h similarity index 100% rename from modules/ripple_json/json/json_reader.h rename to modules/ripple_basics/json/json_reader.h diff --git a/modules/ripple_json/json/json_value.cpp b/modules/ripple_basics/json/json_value.cpp similarity index 100% rename from modules/ripple_json/json/json_value.cpp rename to modules/ripple_basics/json/json_value.cpp diff --git a/modules/ripple_json/json/json_value.h b/modules/ripple_basics/json/json_value.h similarity index 100% rename from modules/ripple_json/json/json_value.h rename to modules/ripple_basics/json/json_value.h diff --git a/modules/ripple_json/json/json_valueiterator.inl b/modules/ripple_basics/json/json_valueiterator.inl similarity index 100% rename from modules/ripple_json/json/json_valueiterator.inl rename to modules/ripple_basics/json/json_valueiterator.inl diff --git a/modules/ripple_json/json/json_writer.cpp b/modules/ripple_basics/json/json_writer.cpp similarity index 100% rename from modules/ripple_json/json/json_writer.cpp rename to modules/ripple_basics/json/json_writer.cpp diff --git a/modules/ripple_json/json/json_writer.h b/modules/ripple_basics/json/json_writer.h similarity index 100% rename from modules/ripple_json/json/json_writer.h rename to modules/ripple_basics/json/json_writer.h diff --git a/modules/ripple_json/json/version b/modules/ripple_basics/json/version similarity index 100% rename from modules/ripple_json/json/version rename to modules/ripple_basics/json/version diff --git a/modules/ripple_basics/ripple_basics.cpp b/modules/ripple_basics/ripple_basics.cpp index 63edebb6e1..6de88267e2 100644 --- a/modules/ripple_basics/ripple_basics.cpp +++ b/modules/ripple_basics/ripple_basics.cpp @@ -14,9 +14,11 @@ #include "ripple_basics.h" -// VFALCO TODO Rewrite Sustain to use beast::Process +//------------------------------------------------------------------------------ + +// For Sustain Linux variants // -// These are for Sustain Linux variants +// VFALCO TODO Rewrite Sustain to use beast::Process #ifdef __linux__ #include #include @@ -27,28 +29,56 @@ #include #endif +//------------------------------------------------------------------------------ + +// For json/ +// +#ifdef JSON_USE_CPPTL +# include +#endif +#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 ); + +//------------------------------------------------------------------------------ + +// For random numbers +// // VFALCO TODO Replace OpenSSL randomness with a dependency-free implementation // Perhaps Schneier's Fortuna or a variant. Abstract the collection of // entropy and provide OS-specific implementation. We can re-use the // BearShare source code for this. // -// Add Random number generation to the new VFLib +// Add Random number generation to beast // #include // Because of ripple_RandomNumbers.cpp #ifdef BEAST_WIN32 -#include // for ripple_RandomNumbers.cpp -#include // for ripple_RandomNumbers.cpp -// Winsock #defines 'max' and does other stupid things so put it last -#include // for ripple_ByteOrder.cpp +# include // for ripple_RandomNumbers.cpp +# include // for ripple_RandomNumbers.cpp +# include // for ripple_ByteOrder.cpp +// defines 'max' and does other stupid things +# ifdef max +# undef max +# endif #endif +//------------------------------------------------------------------------------ + namespace ripple { #include "containers/ripple_RangeSet.cpp" #include "containers/ripple_TaggedCache.cpp" +#include "json/json_reader.cpp" +#include "json/json_value.cpp" +#include "json/json_writer.cpp" + #include "utility/ripple_Log.cpp" #include "utility/ripple_LogFile.cpp" diff --git a/modules/ripple_basics/ripple_basics.h b/modules/ripple_basics/ripple_basics.h index 4f5fb06139..be5e477d9d 100644 --- a/modules/ripple_basics/ripple_basics.h +++ b/modules/ripple_basics/ripple_basics.h @@ -22,7 +22,24 @@ #include "system/ripple_StandardIncludes.h" -// This must come before Boost, to fix the boost placeholders problem +//------------------------------------------------------------------------------ + +// For json/ +// +// VFALCO TODO Clean up these one-offs +#include "json/json_config.h" // Needed before these cpptl includes +#ifndef JSON_USE_CPPTL_SMALLMAP +# include +#else +# include +#endif +#ifdef JSON_USE_CPPTL +# include +#endif + +//------------------------------------------------------------------------------ + +// Must come before #include "beast/modules/beast_core/beast_core.h" #include "system/ripple_BoostIncludes.h" @@ -72,8 +89,6 @@ namespace boost #include "beast/modules/beast_core/beast_core.h" -#include "../ripple_json/ripple_json.h" - namespace ripple { @@ -106,6 +121,12 @@ using namespace beast; #include "containers/ripple_SecureAllocator.h" #include "containers/ripple_TaggedCache.h" +#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" + } #endif diff --git a/modules/ripple_basics/system/ripple_StandardIncludes.h b/modules/ripple_basics/system/ripple_StandardIncludes.h index b20927e779..e21f229e7f 100644 --- a/modules/ripple_basics/system/ripple_StandardIncludes.h +++ b/modules/ripple_basics/system/ripple_StandardIncludes.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/modules/ripple_json/ripple_json.cpp b/modules/ripple_json/ripple_json.cpp deleted file mode 100644 index fc19ce5d47..0000000000 --- a/modules/ripple_json/ripple_json.cpp +++ /dev/null @@ -1,39 +0,0 @@ -//------------------------------------------------------------------------------ -/* - Copyright (c) 2011-2013, OpenCoin, Inc. -*/ -//============================================================================== - -/** Add this to get the @ref ripple_json module. - - @file ripple_json.cpp - @ingroup ripple_json -*/ - -#include "BeastConfig.h" - -#include "ripple_json.h" - -#include -#include - -#ifdef JSON_USE_CPPTL -# include -#endif - -#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 ); - -namespace ripple -{ - -#include "json/json_reader.cpp" -#include "json/json_value.cpp" -#include "json/json_writer.cpp" - -} diff --git a/modules/ripple_json/ripple_json.h b/modules/ripple_json/ripple_json.h deleted file mode 100644 index 7bda52df0d..0000000000 --- a/modules/ripple_json/ripple_json.h +++ /dev/null @@ -1,48 +0,0 @@ -//------------------------------------------------------------------------------ -/* - Copyright (c) 2011-2013, OpenCoin, Inc. -*/ -//============================================================================== - -/** Include this to get the @ref ripple_json module. - - @file ripple_json.h - @ingroup ripple_json -*/ - -/** JSON parsiing and output support. - - A simple set of JSON manipulation classes. - - @defgroup ripple_json -*/ - -#ifndef RIPPLE_JSON_RIPPLEHEADER -#define RIPPLE_JSON_RIPPLEHEADER - -#include "../modules/ripple_basics/ripple_basics.h" - -#include "json/json_config.h" // Needed before these cpptl includes - -#ifndef JSON_USE_CPPTL_SMALLMAP -# include -#else -# include -#endif - -#ifdef JSON_USE_CPPTL -# include -#endif - -namespace ripple -{ - -#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" - -} - -#endif