Skip to content

Commit 18e4d04

Browse files
committed
merged from 1.6.5
2 parents d48bff5 + d84702c commit 18e4d04

File tree

8 files changed

+37
-42
lines changed

8 files changed

+37
-42
lines changed

Diff for: .travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,5 @@ env:
3838
- SHARED_LIB=ON STATIC_LIB=ON CMAKE_PKG=ON BUILD_TYPE=release VERBOSE_MAKE=false
3939
- SHARED_LIB=OFF STATIC_LIB=ON CMAKE_PKG=OFF BUILD_TYPE=debug VERBOSE_MAKE=true VERBOSE
4040
notifications:
41-
email:
42-
41+
email: false
4342
sudo: false

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ ENDMACRO(jsoncpp_parse_version)
6363
#SET( JSONCPP_VERSION_MAJOR X )
6464
#SET( JSONCPP_VERSION_MINOR Y )
6565
#SET( JSONCPP_VERSION_PATCH Z )
66-
SET( JSONCPP_VERSION 0.10.4 )
66+
SET( JSONCPP_VERSION 0.10.5 )
6767
jsoncpp_parse_version( ${JSONCPP_VERSION} JSONCPP_VERSION )
6868
#IF(NOT JSONCPP_VERSION_FOUND)
6969
# MESSAGE(FATAL_ERROR "Failed to parse version string properly. Expect X.Y.Z")

Diff for: include/json/value.h

+29-14
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,36 @@ namespace Json {
3737
*
3838
* We use nothing but these internally. Of course, STL can throw others.
3939
*/
40-
class JSON_API Exception;
40+
class JSON_API Exception : public std::exception {
41+
public:
42+
Exception(std::string const& msg);
43+
virtual ~Exception() throw();
44+
virtual char const* what() const throw();
45+
protected:
46+
std::string const msg_;
47+
};
48+
4149
/** Exceptions which the user cannot easily avoid.
4250
*
4351
* E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
4452
*
4553
* \remark derived from Json::Exception
4654
*/
47-
class JSON_API RuntimeError;
55+
class JSON_API RuntimeError : public Exception {
56+
public:
57+
RuntimeError(std::string const& msg);
58+
};
59+
4860
/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
4961
*
5062
* These are precondition-violations (user bugs) and internal errors (our bugs).
5163
*
5264
* \remark derived from Json::Exception
5365
*/
54-
class JSON_API LogicError;
66+
class JSON_API LogicError : public Exception {
67+
public:
68+
LogicError(std::string const& msg);
69+
};
5570

5671
/// used internally
5772
void throwRuntimeError(std::string const& msg);
@@ -258,7 +273,7 @@ Json::Value obj_value(Json::objectValue); // {}
258273
#endif // if defined(JSON_HAS_INT64)
259274
Value(double value);
260275
Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
261-
Value(const char* beginValue, const char* endValue); ///< Copy all, incl zeroes.
276+
Value(const char* begin, const char* end); ///< Copy all, incl zeroes.
262277
/** \brief Constructs a value from a static string.
263278
264279
* Like other value string constructor but do not duplicate the string for
@@ -309,7 +324,7 @@ Json::Value obj_value(Json::objectValue); // {}
309324
* \return false if !string. (Seg-fault if str or end are NULL.)
310325
*/
311326
bool getString(
312-
char const** str, char const** end) const;
327+
char const** begin, char const** end) const;
313328
#ifdef JSON_USE_CPPTL
314329
CppTL::ConstString asConstString() const;
315330
#endif
@@ -438,8 +453,8 @@ Json::Value obj_value(Json::objectValue); // {}
438453
Value get(const char* key, const Value& defaultValue) const;
439454
/// Return the member named key if it exist, defaultValue otherwise.
440455
/// \note deep copy
441-
/// \param key may contain embedded nulls.
442-
Value get(const char* key, const char* end, const Value& defaultValue) const;
456+
/// \note key may contain embedded nulls.
457+
Value get(const char* begin, const char* end, const Value& defaultValue) const;
443458
/// Return the member named key if it exist, defaultValue otherwise.
444459
/// \note deep copy
445460
/// \param key may contain embedded nulls.
@@ -451,12 +466,12 @@ Json::Value obj_value(Json::objectValue); // {}
451466
#endif
452467
/// Most general and efficient version of isMember()const, get()const,
453468
/// and operator[]const
454-
/// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30
455-
Value const* find(char const* key, char const* end) const;
469+
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
470+
Value const* find(char const* begin, char const* end) const;
456471
/// Most general and efficient version of object-mutators.
457-
/// \note As stated elsewhere, behavior is undefined if (end-key) >= 2^30
472+
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
458473
/// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
459-
Value const* demand(char const* key, char const* end);
474+
Value const* demand(char const* begin, char const* end);
460475
/// \brief Remove and return the named member.
461476
///
462477
/// Do nothing if it did not exist.
@@ -469,7 +484,7 @@ Json::Value obj_value(Json::objectValue); // {}
469484
/// \param key may contain embedded nulls.
470485
/// \deprecated
471486
Value removeMember(const std::string& key);
472-
/// Same as removeMember(const char* key, const char* end, Value* removed),
487+
/// Same as removeMember(const char* begin, const char* end, Value* removed),
473488
/// but 'key' is null-terminated.
474489
bool removeMember(const char* key, Value* removed);
475490
/** \brief Remove the named map member.
@@ -480,7 +495,7 @@ Json::Value obj_value(Json::objectValue); // {}
480495
*/
481496
bool removeMember(std::string const& key, Value* removed);
482497
/// Same as removeMember(std::string const& key, Value* removed)
483-
bool removeMember(const char* key, const char* end, Value* removed);
498+
bool removeMember(const char* begin, const char* end, Value* removed);
484499
/** \brief Remove the indexed array element.
485500
486501
O(n) expensive operations.
@@ -496,7 +511,7 @@ Json::Value obj_value(Json::objectValue); // {}
496511
/// \param key may contain embedded nulls.
497512
bool isMember(const std::string& key) const;
498513
/// Same as isMember(std::string const& key)const
499-
bool isMember(const char* key, const char* end) const;
514+
bool isMember(const char* begin, const char* end) const;
500515
#ifdef JSON_USE_CPPTL
501516
/// Return true if the object has a member named key.
502517
bool isMember(const CppTL::ConstString& key) const;

Diff for: include/json/version.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// DO NOT EDIT. This file is generated by CMake from "version"
2-
// and "version.h.in" files.
1+
// DO NOT EDIT. This file (and "version") is generated by CMake.
32
// Run CMake configure step to update it.
43
#ifndef JSON_VERSION_H_INCLUDED
54
# define JSON_VERSION_H_INCLUDED
65

7-
# define JSONCPP_VERSION_STRING "0.10.4"
6+
# define JSONCPP_VERSION_STRING "0.10.5"
87
# define JSONCPP_VERSION_MAJOR 0
98
# define JSONCPP_VERSION_MINOR 10
10-
# define JSONCPP_VERSION_PATCH 4
9+
# define JSONCPP_VERSION_PATCH 5
1110
# define JSONCPP_VERSION_QUALIFIER
1211
# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
1312

Diff for: src/lib_json/json_tool.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static inline std::string codePointToUTF8(unsigned int cp) {
4343
return result;
4444
}
4545

46-
/// Returns true if ch is a control character (in range [0,32[).
46+
/// Returns true if ch is a control character (in range [1,31]).
4747
static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; }
4848

4949
enum {

Diff for: src/lib_json/json_value.cpp

-17
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,6 @@ static inline void releaseStringValue(char* value) { free(value); }
153153

154154
namespace Json {
155155

156-
class JSON_API Exception : public std::exception {
157-
public:
158-
Exception(std::string const& msg);
159-
virtual ~Exception() throw();
160-
virtual char const* what() const throw();
161-
protected:
162-
std::string const msg_;
163-
};
164-
class JSON_API RuntimeError : public Exception {
165-
public:
166-
RuntimeError(std::string const& msg);
167-
};
168-
class JSON_API LogicError : public Exception {
169-
public:
170-
LogicError(std::string const& msg);
171-
};
172-
173156
Exception::Exception(std::string const& msg)
174157
: msg_(msg)
175158
{}

Diff for: src/lib_json/version.h.in

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// DO NOT EDIT. This file is generated by CMake from "version"
2-
// and "version.h.in" files.
1+
// DO NOT EDIT. This file (and "version") is generated by CMake.
32
// Run CMake configure step to update it.
43
#ifndef JSON_VERSION_H_INCLUDED
54
# define JSON_VERSION_H_INCLUDED

Diff for: version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.10.4
1+
0.10.5

0 commit comments

Comments
 (0)