mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 15:16:47 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c8054483f8 | ||
![]() |
96d32b37ea | ||
![]() |
ef2ff8754a | ||
![]() |
b58c844579 | ||
![]() |
b803b92d11 | ||
![]() |
98e981dff9 | ||
![]() |
1c47796479 | ||
![]() |
12c67e810d |
@@ -64,7 +64,7 @@ ENDMACRO()
|
|||||||
#SET( JSONCPP_VERSION_MAJOR X )
|
#SET( JSONCPP_VERSION_MAJOR X )
|
||||||
#SET( JSONCPP_VERSION_MINOR Y )
|
#SET( JSONCPP_VERSION_MINOR Y )
|
||||||
#SET( JSONCPP_VERSION_PATCH Z )
|
#SET( JSONCPP_VERSION_PATCH Z )
|
||||||
SET( JSONCPP_VERSION 1.7.0 )
|
SET( JSONCPP_VERSION 1.7.2 )
|
||||||
jsoncpp_parse_version( ${JSONCPP_VERSION} JSONCPP_VERSION )
|
jsoncpp_parse_version( ${JSONCPP_VERSION} JSONCPP_VERSION )
|
||||||
#IF(NOT JSONCPP_VERSION_FOUND)
|
#IF(NOT JSONCPP_VERSION_FOUND)
|
||||||
# MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z")
|
# MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z")
|
||||||
|
@@ -77,6 +77,12 @@
|
|||||||
|
|
||||||
#endif // defined(_MSC_VER)
|
#endif // defined(_MSC_VER)
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && _MSC_VER <= 1600 // MSVC <= 2010
|
||||||
|
# define JSONCPP_OVERRIDE
|
||||||
|
#else
|
||||||
|
# define JSONCPP_OVERRIDE override
|
||||||
|
#endif // MSVC <= 2010
|
||||||
|
|
||||||
|
|
||||||
#ifndef JSON_HAS_RVALUE_REFERENCES
|
#ifndef JSON_HAS_RVALUE_REFERENCES
|
||||||
|
|
||||||
@@ -119,11 +125,15 @@
|
|||||||
# define JSON_USE_INT64_DOUBLE_CONVERSION 1
|
# define JSON_USE_INT64_DOUBLE_CONVERSION 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "version.h"
|
#if !defined(JSON_IS_AMALGAMATION)
|
||||||
|
|
||||||
#if JSONCPP_USING_SECURE_MEMORY
|
# include "version.h"
|
||||||
#include "allocator.h" //typedef Allocator
|
|
||||||
#endif
|
# if JSONCPP_USING_SECURE_MEMORY
|
||||||
|
# include "allocator.h" //typedef Allocator
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
|
|
||||||
namespace Json {
|
namespace Json {
|
||||||
typedef int Int;
|
typedef int Int;
|
||||||
|
@@ -333,9 +333,9 @@ public:
|
|||||||
Json::Value settings_;
|
Json::Value settings_;
|
||||||
|
|
||||||
CharReaderBuilder();
|
CharReaderBuilder();
|
||||||
~CharReaderBuilder() override;
|
~CharReaderBuilder() JSONCPP_OVERRIDE;
|
||||||
|
|
||||||
CharReader* newCharReader() const override;
|
CharReader* newCharReader() const JSONCPP_OVERRIDE;
|
||||||
|
|
||||||
/** \return true if 'settings' are legal and consistent;
|
/** \return true if 'settings' are legal and consistent;
|
||||||
* otherwise, indicate bad settings via 'invalid'.
|
* otherwise, indicate bad settings via 'invalid'.
|
||||||
|
@@ -53,8 +53,8 @@ namespace Json {
|
|||||||
class JSON_API Exception : public std::exception {
|
class JSON_API Exception : public std::exception {
|
||||||
public:
|
public:
|
||||||
Exception(JSONCPP_STRING const& msg);
|
Exception(JSONCPP_STRING const& msg);
|
||||||
~Exception() throw() override;
|
~Exception() throw() JSONCPP_OVERRIDE;
|
||||||
char const* what() const throw() override;
|
char const* what() const throw() JSONCPP_OVERRIDE;
|
||||||
protected:
|
protected:
|
||||||
JSONCPP_STRING msg_;
|
JSONCPP_STRING msg_;
|
||||||
};
|
};
|
||||||
|
@@ -3,17 +3,17 @@
|
|||||||
#ifndef JSON_VERSION_H_INCLUDED
|
#ifndef JSON_VERSION_H_INCLUDED
|
||||||
# define JSON_VERSION_H_INCLUDED
|
# define JSON_VERSION_H_INCLUDED
|
||||||
|
|
||||||
# define JSONCPP_VERSION_STRING "1.7.0"
|
# define JSONCPP_VERSION_STRING "1.7.2"
|
||||||
# define JSONCPP_VERSION_MAJOR 1
|
# define JSONCPP_VERSION_MAJOR 1
|
||||||
# define JSONCPP_VERSION_MINOR 7
|
# define JSONCPP_VERSION_MINOR 7
|
||||||
# define JSONCPP_VERSION_PATCH 0
|
# define JSONCPP_VERSION_PATCH 2
|
||||||
# define JSONCPP_VERSION_QUALIFIER
|
# define JSONCPP_VERSION_QUALIFIER
|
||||||
# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
|
# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
|
||||||
|
|
||||||
#ifdef JSONCPP_USING_SECURE_MEMORY
|
#ifdef JSONCPP_USING_SECURE_MEMORY
|
||||||
#undef JSONCPP_USING_SECURE_MEMORY
|
#undef JSONCPP_USING_SECURE_MEMORY
|
||||||
#endif
|
#endif
|
||||||
#define JSONCPP_USING_SECURE_MEMORY 1
|
#define JSONCPP_USING_SECURE_MEMORY 0
|
||||||
// If non-zero, the library zeroes any memory that it has allocated before
|
// If non-zero, the library zeroes any memory that it has allocated before
|
||||||
// it frees its memory.
|
// it frees its memory.
|
||||||
|
|
||||||
|
@@ -112,12 +112,12 @@ public:
|
|||||||
Json::Value settings_;
|
Json::Value settings_;
|
||||||
|
|
||||||
StreamWriterBuilder();
|
StreamWriterBuilder();
|
||||||
~StreamWriterBuilder() override;
|
~StreamWriterBuilder() JSONCPP_OVERRIDE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \throw std::exception if something goes wrong (e.g. invalid settings)
|
* \throw std::exception if something goes wrong (e.g. invalid settings)
|
||||||
*/
|
*/
|
||||||
StreamWriter* newStreamWriter() const override;
|
StreamWriter* newStreamWriter() const JSONCPP_OVERRIDE;
|
||||||
|
|
||||||
/** \return true if 'settings' are legal and consistent;
|
/** \return true if 'settings' are legal and consistent;
|
||||||
* otherwise, indicate bad settings via 'invalid'.
|
* otherwise, indicate bad settings via 'invalid'.
|
||||||
@@ -158,7 +158,7 @@ class JSON_API FastWriter : public Writer {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
FastWriter();
|
FastWriter();
|
||||||
~FastWriter() override {}
|
~FastWriter() JSONCPP_OVERRIDE {}
|
||||||
|
|
||||||
void enableYAMLCompatibility();
|
void enableYAMLCompatibility();
|
||||||
|
|
||||||
@@ -172,7 +172,7 @@ public:
|
|||||||
void omitEndingLineFeed();
|
void omitEndingLineFeed();
|
||||||
|
|
||||||
public: // overridden from Writer
|
public: // overridden from Writer
|
||||||
JSONCPP_STRING write(const Value& root) override;
|
JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void writeValue(const Value& value);
|
void writeValue(const Value& value);
|
||||||
@@ -210,14 +210,14 @@ private:
|
|||||||
class JSON_API StyledWriter : public Writer {
|
class JSON_API StyledWriter : public Writer {
|
||||||
public:
|
public:
|
||||||
StyledWriter();
|
StyledWriter();
|
||||||
~StyledWriter() override {}
|
~StyledWriter() JSONCPP_OVERRIDE {}
|
||||||
|
|
||||||
public: // overridden from Writer
|
public: // overridden from Writer
|
||||||
/** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
|
/** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
|
||||||
* \param root Value to serialize.
|
* \param root Value to serialize.
|
||||||
* \return String containing the JSON document that represents the root value.
|
* \return String containing the JSON document that represents the root value.
|
||||||
*/
|
*/
|
||||||
JSONCPP_STRING write(const Value& root) override;
|
JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void writeValue(const Value& value);
|
void writeValue(const Value& value);
|
||||||
|
@@ -1907,7 +1907,7 @@ public:
|
|||||||
{}
|
{}
|
||||||
bool parse(
|
bool parse(
|
||||||
char const* beginDoc, char const* endDoc,
|
char const* beginDoc, char const* endDoc,
|
||||||
Value* root, JSONCPP_STRING* errs) override {
|
Value* root, JSONCPP_STRING* errs) JSONCPP_OVERRIDE {
|
||||||
bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
|
bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
|
||||||
if (errs) {
|
if (errs) {
|
||||||
*errs = reader_.getFormattedErrorMessages();
|
*errs = reader_.getFormattedErrorMessages();
|
||||||
|
@@ -63,7 +63,7 @@ typedef char UIntToStringBuffer[uintToStringBufferSize];
|
|||||||
static inline void uintToString(LargestUInt value, char*& current) {
|
static inline void uintToString(LargestUInt value, char*& current) {
|
||||||
*--current = 0;
|
*--current = 0;
|
||||||
do {
|
do {
|
||||||
*--current = static_cast<signed char>(value % 10U + static_cast<unsigned>('0'));
|
*--current = static_cast<char>(value % 10U + static_cast<unsigned>('0'));
|
||||||
value /= 10;
|
value /= 10;
|
||||||
} while (value != 0);
|
} while (value != 0);
|
||||||
}
|
}
|
||||||
|
@@ -839,7 +839,7 @@ struct BuiltStyledStreamWriter : public StreamWriter
|
|||||||
JSONCPP_STRING const& endingLineFeedSymbol,
|
JSONCPP_STRING const& endingLineFeedSymbol,
|
||||||
bool useSpecialFloats,
|
bool useSpecialFloats,
|
||||||
unsigned int precision);
|
unsigned int precision);
|
||||||
int write(Value const& root, JSONCPP_OSTREAM* sout) override;
|
int write(Value const& root, JSONCPP_OSTREAM* sout) JSONCPP_OVERRIDE;
|
||||||
private:
|
private:
|
||||||
void writeValue(Value const& value);
|
void writeValue(Value const& value);
|
||||||
void writeArrayValue(Value const& value);
|
void writeArrayValue(Value const& value);
|
||||||
|
@@ -271,8 +271,8 @@ TestResult& checkStringEqual(TestResult& result,
|
|||||||
} \
|
} \
|
||||||
\
|
\
|
||||||
public: /* overidden from TestCase */ \
|
public: /* overidden from TestCase */ \
|
||||||
const char* testName() const override { return #FixtureType "/" #name; } \
|
const char* testName() const JSONCPP_OVERRIDE { return #FixtureType "/" #name; } \
|
||||||
void runTestCase() override; \
|
void runTestCase() JSONCPP_OVERRIDE; \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
void Test##FixtureType##name::runTestCase()
|
void Test##FixtureType##name::runTestCase()
|
||||||
|
Reference in New Issue
Block a user