Aaron Jacobs | c025697 | 2011-05-26 02:46:28 +0000 | [diff] [blame] | 1 | New in SVN |
| 2 | ---------- |
Aaron Jacobs | 1b138e8 | 2011-05-25 04:19:17 +0000 | [diff] [blame] | 3 | |
Aaron Jacobs | c025697 | 2011-05-26 02:46:28 +0000 | [diff] [blame] | 4 | * Updated the type system's behavior, in order to better support backwards |
| 5 | compatibility with code that was written before 64-bit integer support was |
| 6 | introduced. Here's how it works now: |
Aaron Jacobs | 1b138e8 | 2011-05-25 04:19:17 +0000 | [diff] [blame] | 7 | |
Aaron Jacobs | c025697 | 2011-05-26 02:46:28 +0000 | [diff] [blame] | 8 | * isInt, isInt64, isUInt, and isUInt64 return true if and only if the |
| 9 | value can be exactly represented as that type. In particular, a value |
| 10 | constructed with a double like 17.0 will now return true for all of |
| 11 | these methods. |
Aaron Jacobs | 1b138e8 | 2011-05-25 04:19:17 +0000 | [diff] [blame] | 12 | |
Aaron Jacobs | c025697 | 2011-05-26 02:46:28 +0000 | [diff] [blame] | 13 | * isDouble and isFloat now return true for all numeric values, since all |
| 14 | numeric values can be converted to a double or float without |
| 15 | truncation. Note however that the conversion may not be exact -- for |
| 16 | example, doubles cannot exactly represent all integers above 2^53 + 1. |
Aaron Jacobs | 1b138e8 | 2011-05-25 04:19:17 +0000 | [diff] [blame] | 17 | |
Aaron Jacobs | c025697 | 2011-05-26 02:46:28 +0000 | [diff] [blame] | 18 | * isBool, isNull, isString, isArray, and isObject now return true if and |
| 19 | only if the value is of that type. |
Aaron Jacobs | 1b138e8 | 2011-05-25 04:19:17 +0000 | [diff] [blame] | 20 | |
Aaron Jacobs | c025697 | 2011-05-26 02:46:28 +0000 | [diff] [blame] | 21 | * isConvertibleTo(fooValue) indicates that it is safe to call asFoo. |
| 22 | (For each type foo, isFoo always implies isConvertibleTo(fooValue).) |
| 23 | asFoo returns an approximate or exact representation as appropriate. |
| 24 | For example, a double value may be truncated when asInt is called. |
| 25 | |
| 26 | * For backwards compatibility with old code, isConvertibleTo(intValue) |
| 27 | may return false even if type() == intValue. This is because the value |
| 28 | may have been constructed with a 64-bit integer larger than maxInt, |
| 29 | and calling asInt() would cause an exception. If you're writing new |
| 30 | code, use isInt64 to find out whether the value is exactly |
| 31 | representable using an Int64, or asDouble() combined with minInt64 and |
| 32 | maxInt64 to figure out whether it is approximately representable. |
| 33 | |
Baptiste Lepilleur | a8afdd4 | 2013-04-12 14:10:13 +0000 | [diff] [blame] | 34 | * Value |
Baptiste Lepilleur | eafd702 | 2013-05-08 20:21:11 +0000 | [diff] [blame] | 35 | - Patch #10: BOOST_FOREACH compatibility. Made Json::iterator more |
Baptiste Lepilleur | a8afdd4 | 2013-04-12 14:10:13 +0000 | [diff] [blame] | 36 | standard compliant, added missing iterator_category and value_type |
| 37 | typedefs (contribued by Robert A. Iannucci). |
| 38 | |
| 39 | * Compilation |
| 40 | |
Baptiste Lepilleur | eafd702 | 2013-05-08 20:21:11 +0000 | [diff] [blame] | 41 | - New CMake based build system. Based in part on contribution from |
| 42 | Igor Okulist and Damien Buhl (Patch #14). |
| 43 | |
| 44 | - New header json/version.h now contains version number macros |
| 45 | (JSONCPP_VERSION_MAJOR, JSONCPP_VERSION_MINOR, JSONCPP_VERSION_PATCH |
| 46 | and JSONCPP_VERSION_HEXA). |
| 47 | |
| 48 | - Patch #11: added missing JSON_API on some classes causing link issues |
Baptiste Lepilleur | a8afdd4 | 2013-04-12 14:10:13 +0000 | [diff] [blame] | 49 | when building as a dynamic library on Windows |
| 50 | (contributed by Francis Bolduc). |
Baptiste Lepilleur | eafd702 | 2013-05-08 20:21:11 +0000 | [diff] [blame] | 51 | |
| 52 | - Visual Studio DLL: suppressed warning "C4251: <data member>: <type> |
| 53 | needs to have dll-interface to be used by..." via pragma push/pop |
| 54 | in json-cpp headers. |
Baptiste Lepilleur | 1ccfdfc | 2013-05-09 15:20:32 +0000 | [diff] [blame] | 55 | |
| 56 | - Added Travis CI intregration: https://travis-ci.org/blep/jsoncpp-mirror |
Baptiste Lepilleur | a8afdd4 | 2013-04-12 14:10:13 +0000 | [diff] [blame] | 57 | |
Baptiste Lepilleur | 3f12417 | 2013-04-12 13:11:14 +0000 | [diff] [blame] | 58 | * Bug fixes |
Baptiste Lepilleur | eafd702 | 2013-05-08 20:21:11 +0000 | [diff] [blame] | 59 | - Patch #15: Copy constructor does not initialize allocated_ for stringValue |
Baptiste Lepilleur | 3f12417 | 2013-04-12 13:11:14 +0000 | [diff] [blame] | 60 | (contributed by rmongia). |
| 61 | |
Baptiste Lepilleur | eafd702 | 2013-05-08 20:21:11 +0000 | [diff] [blame] | 62 | - Patch #16: Missing field copy in Json::Value::iterator causing infinite |
Baptiste Lepilleur | f92ace5 | 2013-04-12 13:26:23 +0000 | [diff] [blame] | 63 | loop when using experimental internal map (#define JSON_VALUE_USE_INTERNAL_MAP) |
| 64 | (contributed by Ming-Lin Kao). |
Baptiste Lepilleur | 3f12417 | 2013-04-12 13:11:14 +0000 | [diff] [blame] | 65 | |
Aaron Jacobs | 1b138e8 | 2011-05-25 04:19:17 +0000 | [diff] [blame] | 66 | |
Baptiste Lepilleur | 130730f | 2010-03-13 11:14:49 +0000 | [diff] [blame] | 67 | New in JsonCpp 0.6.0: |
| 68 | --------------------- |
| 69 | |
| 70 | * Compilation |
| 71 | |
Baptiste Lepilleur | 99043b3 | 2011-05-01 15:47:38 +0000 | [diff] [blame] | 72 | - LD_LIBRARY_PATH and LIBRARY_PATH environment variables are now |
| 73 | propagated to the build environment as this is required for some |
| 74 | compiler installation. |
Baptiste Lepilleur | 130730f | 2010-03-13 11:14:49 +0000 | [diff] [blame] | 75 | |
| 76 | - Added support for Microsoft Visual Studio 2008 (bug #2930462): |
| 77 | The platform "msvc90" has been added. |
| 78 | |
| 79 | Notes: you need to setup the environment by running vcvars32.bat |
| 80 | (e.g. MSVC 2008 command prompt in start menu) before running scons. |
| 81 | |
Baptiste Lepilleur | eadc478 | 2011-05-02 21:09:30 +0000 | [diff] [blame] | 82 | - Added support for amalgamated source and header generation (a la sqlite). |
Christopher Dunn | f4bc0bf | 2015-01-24 15:43:23 -0600 | [diff] [blame] | 83 | Refer to README.md section "Generating amalgamated source and header" |
Baptiste Lepilleur | 64e40aa | 2011-05-01 20:13:40 +0000 | [diff] [blame] | 84 | for detail. |
| 85 | |
Baptiste Lepilleur | afd9cef | 2010-03-13 13:10:27 +0000 | [diff] [blame] | 86 | * Value |
| 87 | |
| 88 | - Removed experimental ValueAllocator, it caused static |
| 89 | initialization/destruction order issues (bug #2934500). |
| 90 | The DefaultValueAllocator has been inlined in code. |
| 91 | |
Baptiste Lepilleur | 842e9ac | 2010-12-27 17:45:23 +0000 | [diff] [blame] | 92 | - Added support for 64 bits integer: |
| 93 | |
| 94 | Types Json::Int64 and Json::UInt64 have been added. They are aliased |
| 95 | to 64 bits integers on system that support them (based on __int64 on |
| 96 | Microsoft Visual Studio platform, and long long on other platforms). |
| 97 | |
| 98 | Types Json::LargestInt and Json::LargestUInt have been added. They are |
| 99 | aliased to the largest integer type supported: |
| 100 | either Json::Int/Json::UInt or Json::Int64/Json::UInt64 respectively. |
| 101 | |
| 102 | Json::Value::asInt() and Json::Value::asUInt() still returns plain |
| 103 | "int" based types, but asserts if an attempt is made to retrieve |
| 104 | a 64 bits value that can not represented as the return type. |
| 105 | |
| 106 | Json::Value::asInt64() and Json::Value::asUInt64() have been added |
| 107 | to obtain the 64 bits integer value. |
| 108 | |
| 109 | Json::Value::asLargestInt() and Json::Value::asLargestUInt() returns |
| 110 | the integer as a LargestInt/LargestUInt respectively. Those functions |
| 111 | functions are typically used when implementing writer. |
| 112 | |
| 113 | The reader attempts to read number as 64 bits integer, and fall back |
| 114 | to reading a double if the number is not in the range of 64 bits |
| 115 | integer. |
Baptiste Lepilleur | 201fb2c | 2010-04-19 07:37:41 +0000 | [diff] [blame] | 116 | |
| 117 | Warning: Json::Value::asInt() and Json::Value::asUInt() now returns |
| 118 | long long. This changes break code that was passing the return value |
| 119 | to *printf() function. |
Baptiste Lepilleur | 842e9ac | 2010-12-27 17:45:23 +0000 | [diff] [blame] | 120 | |
| 121 | Support for 64 bits integer can be disabled by defining the macro |
| 122 | JSON_NO_INT64 (uncomment it in json/config.h for example), though |
| 123 | it should have no impact on existing usage. |
Baptiste Lepilleur | 201fb2c | 2010-04-19 07:37:41 +0000 | [diff] [blame] | 124 | |
| 125 | - The type Json::ArrayIndex is used for indexes of a JSON value array. It |
| 126 | is an unsigned int (typically 32 bits). |
Baptiste Lepilleur | fa130ef | 2010-12-24 12:47:14 +0000 | [diff] [blame] | 127 | |
| 128 | - Array index can be passed as int to operator[], allowing use of literal: |
| 129 | Json::Value array; |
| 130 | array.append( 1234 ); |
| 131 | int value = array[0].asInt(); // did not compile previously |
Baptiste Lepilleur | 7469f1d | 2010-04-20 21:35:19 +0000 | [diff] [blame] | 132 | |
Baptiste Lepilleur | b96aed0 | 2010-12-24 19:30:06 +0000 | [diff] [blame] | 133 | - Added float Json::Value::asFloat() to obtain a floating point value as a |
| 134 | float (avoid lost of precision warning caused by used of asDouble() |
| 135 | to initialize a float). |
| 136 | |
Baptiste Lepilleur | b2e8ccc | 2011-05-01 16:27:55 +0000 | [diff] [blame] | 137 | * Reader |
| 138 | |
| 139 | - Renamed Reader::getFormatedErrorMessages() to getFormattedErrorMessages. |
| 140 | Bug #3023708 (Formatted has 2 't'). The old member function is deprecated |
| 141 | but still present for backward compatibility. |
| 142 | |
Baptiste Lepilleur | e6046e5 | 2010-04-27 16:38:30 +0000 | [diff] [blame] | 143 | * Tests |
| 144 | |
| 145 | - Added test to ensure that the escape sequence "\/" is corrected handled |
| 146 | by the parser. |
| 147 | |
Baptiste Lepilleur | 9c98f22 | 2011-05-01 15:40:47 +0000 | [diff] [blame] | 148 | * Bug fixes |
| 149 | |
Baptiste Lepilleur | 99043b3 | 2011-05-01 15:47:38 +0000 | [diff] [blame] | 150 | - Bug #3139677: JSON [1 2 3] was incorrectly parsed as [1, 3]. Error is now |
| 151 | correctly detected. |
| 152 | |
| 153 | - Bug #3139678: stack buffer overflow when parsing a double with a |
| 154 | length of 32 characters. |
Baptiste Lepilleur | fb17080 | 2011-05-02 16:53:10 +0000 | [diff] [blame] | 155 | |
| 156 | - Fixed Value::operator <= implementation (had the semantic of operator >=). |
Christopher Dunn | c3763f5 | 2011-06-24 21:15:30 +0000 | [diff] [blame] | 157 | Found when adding unit tests for comparison operators. |
Baptiste Lepilleur | b2e8ccc | 2011-05-01 16:27:55 +0000 | [diff] [blame] | 158 | |
Baptiste Lepilleur | 1837a1c | 2011-05-02 20:11:48 +0000 | [diff] [blame] | 159 | - Value::compare() is now const and has an actual implementation with |
| 160 | unit tests. |
Christopher Dunn | c3763f5 | 2011-06-24 21:15:30 +0000 | [diff] [blame] | 161 | |
| 162 | - Bug #2407932: strpbrk() can fail for NULL pointer. |
| 163 | |
| 164 | - Bug #3306345: Fixed minor typo in Path::resolve(). |
| 165 | |
| 166 | - Bug #3314841/#3306896: errors in amalgamate.py |
| 167 | |
| 168 | - Fixed some Coverity warnings and line-endings. |
Baptiste Lepilleur | 1837a1c | 2011-05-02 20:11:48 +0000 | [diff] [blame] | 169 | |
Baptiste Lepilleur | 7469f1d | 2010-04-20 21:35:19 +0000 | [diff] [blame] | 170 | * License |
| 171 | |
| 172 | - See file LICENSE for details. Basically JsonCpp is now licensed under |
| 173 | MIT license, or public domain if desired and recognized in your jurisdiction. |
Baptiste Lepilleur | e6046e5 | 2010-04-27 16:38:30 +0000 | [diff] [blame] | 174 | Thanks to Stephan G. Beal [http://wanderinghorse.net/home/stephan/]) who |
| 175 | helped figuring out the solution to the public domain issue. |