Merge branch 'master' into typos
This commit is contained in:
commit
761ec58278
@ -72,11 +72,11 @@ project(jsoncpp
|
|||||||
# 2. ./include/json/version.h
|
# 2. ./include/json/version.h
|
||||||
# 3. ./CMakeLists.txt
|
# 3. ./CMakeLists.txt
|
||||||
# IMPORTANT: also update the PROJECT_SOVERSION!!
|
# IMPORTANT: also update the PROJECT_SOVERSION!!
|
||||||
VERSION 1.9.4 # <major>[.<minor>[.<patch>[.<tweak>]]]
|
VERSION 1.9.5 # <major>[.<minor>[.<patch>[.<tweak>]]]
|
||||||
LANGUAGES CXX)
|
LANGUAGES CXX)
|
||||||
|
|
||||||
message(STATUS "JsonCpp Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
message(STATUS "JsonCpp Version: ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
|
||||||
set(PROJECT_SOVERSION 24)
|
set(PROJECT_SOVERSION 25)
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInSourceBuilds.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInSourceBuilds.cmake)
|
||||||
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInBuildInstalls.cmake)
|
include(${CMAKE_CURRENT_SOURCE_DIR}/include/PreventInBuildInstalls.cmake)
|
||||||
|
@ -33,8 +33,7 @@ namespace Json {
|
|||||||
* \deprecated Use CharReader and CharReaderBuilder.
|
* \deprecated Use CharReader and CharReaderBuilder.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class JSONCPP_DEPRECATED(
|
class JSON_API Reader {
|
||||||
"Use CharReader and CharReaderBuilder instead.") JSON_API Reader {
|
|
||||||
public:
|
public:
|
||||||
using Char = char;
|
using Char = char;
|
||||||
using Location = const Char*;
|
using Location = const Char*;
|
||||||
@ -51,13 +50,13 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
/** \brief Constructs a Reader allowing all features for parsing.
|
/** \brief Constructs a Reader allowing all features for parsing.
|
||||||
|
* \deprecated Use CharReader and CharReaderBuilder.
|
||||||
*/
|
*/
|
||||||
JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead")
|
|
||||||
Reader();
|
Reader();
|
||||||
|
|
||||||
/** \brief Constructs a Reader allowing the specified feature set for parsing.
|
/** \brief Constructs a Reader allowing the specified feature set for parsing.
|
||||||
|
* \deprecated Use CharReader and CharReaderBuilder.
|
||||||
*/
|
*/
|
||||||
JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead")
|
|
||||||
Reader(const Features& features);
|
Reader(const Features& features);
|
||||||
|
|
||||||
/** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
|
/** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
// 3. /CMakeLists.txt
|
// 3. /CMakeLists.txt
|
||||||
// IMPORTANT: also update the SOVERSION!!
|
// IMPORTANT: also update the SOVERSION!!
|
||||||
|
|
||||||
#define JSONCPP_VERSION_STRING "1.9.4"
|
#define JSONCPP_VERSION_STRING "1.9.5"
|
||||||
#define JSONCPP_VERSION_MAJOR 1
|
#define JSONCPP_VERSION_MAJOR 1
|
||||||
#define JSONCPP_VERSION_MINOR 9
|
#define JSONCPP_VERSION_MINOR 9
|
||||||
#define JSONCPP_VERSION_PATCH 4
|
#define JSONCPP_VERSION_PATCH 5
|
||||||
#define JSONCPP_VERSION_QUALIFIER
|
#define JSONCPP_VERSION_QUALIFIER
|
||||||
#define JSONCPP_VERSION_HEXA \
|
#define JSONCPP_VERSION_HEXA \
|
||||||
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
|
((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \
|
||||||
|
@ -147,7 +147,7 @@ public:
|
|||||||
/** \brief Abstract class for writers.
|
/** \brief Abstract class for writers.
|
||||||
* \deprecated Use StreamWriter. (And really, this is an implementation detail.)
|
* \deprecated Use StreamWriter. (And really, this is an implementation detail.)
|
||||||
*/
|
*/
|
||||||
class JSONCPP_DEPRECATED("Use StreamWriter instead") JSON_API Writer {
|
class JSON_API Writer {
|
||||||
public:
|
public:
|
||||||
virtual ~Writer();
|
virtual ~Writer();
|
||||||
|
|
||||||
@ -167,7 +167,7 @@ public:
|
|||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4996) // Deriving from deprecated class
|
#pragma warning(disable : 4996) // Deriving from deprecated class
|
||||||
#endif
|
#endif
|
||||||
class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API FastWriter
|
class JSON_API FastWriter
|
||||||
: public Writer {
|
: public Writer {
|
||||||
public:
|
public:
|
||||||
FastWriter();
|
FastWriter();
|
||||||
@ -227,7 +227,7 @@ private:
|
|||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4996) // Deriving from deprecated class
|
#pragma warning(disable : 4996) // Deriving from deprecated class
|
||||||
#endif
|
#endif
|
||||||
class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API
|
class JSON_API
|
||||||
StyledWriter : public Writer {
|
StyledWriter : public Writer {
|
||||||
public:
|
public:
|
||||||
StyledWriter();
|
StyledWriter();
|
||||||
@ -296,7 +296,7 @@ private:
|
|||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable : 4996) // Deriving from deprecated class
|
#pragma warning(disable : 4996) // Deriving from deprecated class
|
||||||
#endif
|
#endif
|
||||||
class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API
|
class JSON_API
|
||||||
StyledStreamWriter {
|
StyledStreamWriter {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -50,7 +50,7 @@ jsoncpp_lib = library(
|
|||||||
'src/lib_json/json_value.cpp',
|
'src/lib_json/json_value.cpp',
|
||||||
'src/lib_json/json_writer.cpp',
|
'src/lib_json/json_writer.cpp',
|
||||||
]),
|
]),
|
||||||
soversion : 24,
|
soversion : 25,
|
||||||
install : true,
|
install : true,
|
||||||
include_directories : jsoncpp_include_directories,
|
include_directories : jsoncpp_include_directories,
|
||||||
cpp_args: dll_export_flag)
|
cpp_args: dll_export_flag)
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#endif // if !defined(JSON_IS_AMALGAMATION)
|
#endif // if !defined(JSON_IS_AMALGAMATION)
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <istream>
|
#include <istream>
|
||||||
@ -600,9 +601,15 @@ bool Reader::decodeDouble(Token& token, Value& decoded) {
|
|||||||
double value = 0;
|
double value = 0;
|
||||||
String buffer(token.start_, token.end_);
|
String buffer(token.start_, token.end_);
|
||||||
IStringStream is(buffer);
|
IStringStream is(buffer);
|
||||||
if (!(is >> value))
|
if (!(is >> value)) {
|
||||||
return addError(
|
if (value == std::numeric_limits<double>::max())
|
||||||
|
value = std::numeric_limits<double>::infinity();
|
||||||
|
else if (value == std::numeric_limits<double>::lowest())
|
||||||
|
value = -std::numeric_limits<double>::infinity();
|
||||||
|
else if (!std::isinf(value))
|
||||||
|
return addError(
|
||||||
"'" + String(token.start_, token.end_) + "' is not a number.", token);
|
"'" + String(token.start_, token.end_) + "' is not a number.", token);
|
||||||
|
}
|
||||||
decoded = value;
|
decoded = value;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1647,7 +1654,12 @@ bool OurReader::decodeDouble(Token& token, Value& decoded) {
|
|||||||
const String buffer(token.start_, token.end_);
|
const String buffer(token.start_, token.end_);
|
||||||
IStringStream is(buffer);
|
IStringStream is(buffer);
|
||||||
if (!(is >> value)) {
|
if (!(is >> value)) {
|
||||||
return addError(
|
if (value == std::numeric_limits<double>::max())
|
||||||
|
value = std::numeric_limits<double>::infinity();
|
||||||
|
else if (value == std::numeric_limits<double>::lowest())
|
||||||
|
value = -std::numeric_limits<double>::infinity();
|
||||||
|
else if (!std::isinf(value))
|
||||||
|
return addError(
|
||||||
"'" + String(token.start_, token.end_) + "' is not a number.", token);
|
"'" + String(token.start_, token.end_) + "' is not a number.", token);
|
||||||
}
|
}
|
||||||
decoded = value;
|
decoded = value;
|
||||||
|
3
test/data/legacy_test_real_13.expected
Normal file
3
test/data/legacy_test_real_13.expected
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.=[]
|
||||||
|
.[0]=-inf
|
||||||
|
.[1]=inf
|
1
test/data/legacy_test_real_13.json
Normal file
1
test/data/legacy_test_real_13.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[-1e+9999, 1e+9999]
|
Loading…
Reference in New Issue
Block a user