blob: 5733fcd5ef4a8ffb10a8d17214c941f19837eb0c [file] [log] [blame]
Aaron Jacobsc0256972011-05-26 02:46:28 +00001New in SVN
2----------
Aaron Jacobs1b138e82011-05-25 04:19:17 +00003
Aaron Jacobsc0256972011-05-26 02:46:28 +00004 * 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 Jacobs1b138e82011-05-25 04:19:17 +00007
Aaron Jacobsc0256972011-05-26 02:46:28 +00008 * 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 Jacobs1b138e82011-05-25 04:19:17 +000012
Aaron Jacobsc0256972011-05-26 02:46:28 +000013 * 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 Jacobs1b138e82011-05-25 04:19:17 +000017
Aaron Jacobsc0256972011-05-26 02:46:28 +000018 * isBool, isNull, isString, isArray, and isObject now return true if and
19 only if the value is of that type.
Aaron Jacobs1b138e82011-05-25 04:19:17 +000020
Aaron Jacobsc0256972011-05-26 02:46:28 +000021 * 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 Lepilleura8afdd42013-04-12 14:10:13 +000034* Value
Baptiste Lepilleureafd7022013-05-08 20:21:11 +000035 - Patch #10: BOOST_FOREACH compatibility. Made Json::iterator more
Baptiste Lepilleura8afdd42013-04-12 14:10:13 +000036 standard compliant, added missing iterator_category and value_type
37 typedefs (contribued by Robert A. Iannucci).
38
39* Compilation
40
Baptiste Lepilleureafd7022013-05-08 20:21:11 +000041 - 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 Lepilleura8afdd42013-04-12 14:10:13 +000049 when building as a dynamic library on Windows
50 (contributed by Francis Bolduc).
Baptiste Lepilleureafd7022013-05-08 20:21:11 +000051
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 Lepilleur1ccfdfc2013-05-09 15:20:32 +000055
56 - Added Travis CI intregration: https://travis-ci.org/blep/jsoncpp-mirror
Baptiste Lepilleura8afdd42013-04-12 14:10:13 +000057
Baptiste Lepilleur3f124172013-04-12 13:11:14 +000058* Bug fixes
Baptiste Lepilleureafd7022013-05-08 20:21:11 +000059 - Patch #15: Copy constructor does not initialize allocated_ for stringValue
Baptiste Lepilleur3f124172013-04-12 13:11:14 +000060 (contributed by rmongia).
61
Baptiste Lepilleureafd7022013-05-08 20:21:11 +000062 - Patch #16: Missing field copy in Json::Value::iterator causing infinite
Baptiste Lepilleurf92ace52013-04-12 13:26:23 +000063 loop when using experimental internal map (#define JSON_VALUE_USE_INTERNAL_MAP)
64 (contributed by Ming-Lin Kao).
Baptiste Lepilleur3f124172013-04-12 13:11:14 +000065
Aaron Jacobs1b138e82011-05-25 04:19:17 +000066
Baptiste Lepilleur130730f2010-03-13 11:14:49 +000067 New in JsonCpp 0.6.0:
68 ---------------------
69
70* Compilation
71
Baptiste Lepilleur99043b32011-05-01 15:47:38 +000072 - 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 Lepilleur130730f2010-03-13 11:14:49 +000075
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 Lepilleureadc4782011-05-02 21:09:30 +000082 - Added support for amalgamated source and header generation (a la sqlite).
Christopher Dunnf4bc0bf2015-01-24 15:43:23 -060083 Refer to README.md section "Generating amalgamated source and header"
Baptiste Lepilleur64e40aa2011-05-01 20:13:40 +000084 for detail.
85
Baptiste Lepilleurafd9cef2010-03-13 13:10:27 +000086* 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 Lepilleur842e9ac2010-12-27 17:45:23 +000092 - 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 Lepilleur201fb2c2010-04-19 07:37:41 +0000116
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 Lepilleur842e9ac2010-12-27 17:45:23 +0000120
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 Lepilleur201fb2c2010-04-19 07:37:41 +0000124
125 - The type Json::ArrayIndex is used for indexes of a JSON value array. It
126 is an unsigned int (typically 32 bits).
Baptiste Lepilleurfa130ef2010-12-24 12:47:14 +0000127
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 Lepilleur7469f1d2010-04-20 21:35:19 +0000132
Baptiste Lepilleurb96aed02010-12-24 19:30:06 +0000133 - 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 Lepilleurb2e8ccc2011-05-01 16:27:55 +0000137* 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 Lepilleure6046e52010-04-27 16:38:30 +0000143* Tests
144
145 - Added test to ensure that the escape sequence "\/" is corrected handled
146 by the parser.
147
Baptiste Lepilleur9c98f222011-05-01 15:40:47 +0000148* Bug fixes
149
Baptiste Lepilleur99043b32011-05-01 15:47:38 +0000150 - 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 Lepilleurfb170802011-05-02 16:53:10 +0000155
156 - Fixed Value::operator <= implementation (had the semantic of operator >=).
Christopher Dunnc3763f52011-06-24 21:15:30 +0000157 Found when adding unit tests for comparison operators.
Baptiste Lepilleurb2e8ccc2011-05-01 16:27:55 +0000158
Baptiste Lepilleur1837a1c2011-05-02 20:11:48 +0000159 - Value::compare() is now const and has an actual implementation with
160 unit tests.
Christopher Dunnc3763f52011-06-24 21:15:30 +0000161
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 Lepilleur1837a1c2011-05-02 20:11:48 +0000169
Baptiste Lepilleur7469f1d2010-04-20 21:35:19 +0000170* 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 Lepilleure6046e52010-04-27 16:38:30 +0000174 Thanks to Stephan G. Beal [http://wanderinghorse.net/home/stephan/]) who
175 helped figuring out the solution to the public domain issue.