Tidy Json:

* Remove unused code.
  * Rename .inl file to .cpp.
  * Remove duplicate macros.
This commit is contained in:
Tom Ritchford
2015-06-26 15:51:10 -04:00
committed by Nik Bougalis
parent 57689c4e66
commit 7ef6e58024
5 changed files with 12 additions and 52 deletions

View File

@@ -2205,8 +2205,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\json\impl\json_valueiterator.inl"> <ClCompile Include="..\..\src\ripple\json\impl\json_valueiterator.cpp">
</ClInclude> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\json\impl\json_writer.cpp"> <ClCompile Include="..\..\src\ripple\json\impl\json_writer.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='debug|x64'">True</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='release|x64'">True</ExcludedFromBuild>

View File

@@ -2913,9 +2913,9 @@
<ClCompile Include="..\..\src\ripple\json\impl\json_value.cpp"> <ClCompile Include="..\..\src\ripple\json\impl\json_value.cpp">
<Filter>ripple\json\impl</Filter> <Filter>ripple\json\impl</Filter>
</ClCompile> </ClCompile>
<ClInclude Include="..\..\src\ripple\json\impl\json_valueiterator.inl"> <ClCompile Include="..\..\src\ripple\json\impl\json_valueiterator.cpp">
<Filter>ripple\json\impl</Filter> <Filter>ripple\json\impl</Filter>
</ClInclude> </ClCompile>
<ClCompile Include="..\..\src\ripple\json\impl\json_writer.cpp"> <ClCompile Include="..\..\src\ripple\json\impl\json_writer.cpp">
<Filter>ripple\json\impl</Filter> <Filter>ripple\json\impl</Filter>
</ClCompile> </ClCompile>

View File

@@ -30,34 +30,6 @@ const Int Value::minInt = Int ( ~ (UInt (-1) / 2) );
const Int Value::maxInt = Int ( UInt (-1) / 2 ); const Int Value::maxInt = Int ( UInt (-1) / 2 );
const UInt Value::maxUInt = UInt (-1); const UInt Value::maxUInt = UInt (-1);
// A "safe" implementation of strdup. Allow null pointer to be passed.
// Also avoid warning on msvc80.
//
//inline char *safeStringDup( const char *czstring )
//{
// if ( czstring )
// {
// const size_t length = (unsigned int)( strlen(czstring) + 1 );
// char *newString = static_cast<char *>( malloc( length ) );
// memcpy( newString, czstring, length );
// return newString;
// }
// return 0;
//}
//
//inline char *safeStringDup( std::string const&str )
//{
// if ( !str.empty() )
// {
// const size_t length = str.length();
// char *newString = static_cast<char *>( malloc( length + 1 ) );
// memcpy( newString, str.c_str(), length );
// newString[length] = 0;
// return newString;
// }
// return 0;
//}
ValueAllocator::~ValueAllocator () ValueAllocator::~ValueAllocator ()
{ {
} }
@@ -116,18 +88,6 @@ static struct DummyValueAllocatorInitializer
} }
} dummyValueAllocatorInitializer; } dummyValueAllocatorInitializer;
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
// ValueInternals...
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////
# include <ripple/json/impl/json_valueiterator.inl>
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////

View File

@@ -18,8 +18,10 @@
//============================================================================== //==============================================================================
// included by json_value.cpp // included by json_value.cpp
// everything is within Json namespace
#include <ripple/json/json_value.h>
namespace Json {
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
// ////////////////////////////////////////////////////////////////// // //////////////////////////////////////////////////////////////////
@@ -206,3 +208,5 @@ ValueIterator::operator = ( const SelfType& other )
copy ( other ); copy ( other );
return *this; return *this;
} }
} // Json

View File

@@ -25,15 +25,9 @@
#include <sstream> #include <sstream>
#include <string> #include <string>
// For json/
//
#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 );
#include <ripple/json/impl/json_reader.cpp> #include <ripple/json/impl/json_reader.cpp>
#include <ripple/json/impl/json_value.cpp> #include <ripple/json/impl/json_value.cpp>
#include <ripple/json/impl/json_valueiterator.cpp>
#include <ripple/json/impl/json_writer.cpp> #include <ripple/json/impl/json_writer.cpp>
#include <ripple/json/impl/to_string.cpp> #include <ripple/json/impl/to_string.cpp>