external/jsoncpp/jsoncpp/src/lib_json.git
2 months agofix stdexcept master
christopherdunn [Tue, 13 May 2014 09:49:25 +0000 (09:49 +0000)]
fix stdexcept

https://sourceforge.net/p/jsoncpp/bugs/68/

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@283 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 months agoAdded structured error reporting to Reader.
aaronjacobs [Wed, 23 Apr 2014 23:41:12 +0000 (23:41 +0000)]
Added structured error reporting to Reader.

This allows applications for interactively viewing or editing JSON to do
a better job of highlighting errors. Also added offset accessors to
Value, offering the same sort of functionality even for non-errors.

Thanks to Zach Clifford (zacharyc@google.com) for the patch.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@281 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 months agoAdded features that allow the reader to accept common non-standard JSON.
aaronjacobs [Wed, 23 Apr 2014 23:28:23 +0000 (23:28 +0000)]
Added features that allow the reader to accept common non-standard JSON.

This is a version of patch #17, from Clay Wood:

    http://sourceforge.net/p/jsoncpp/patches/17/

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@280 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 months agovim modeline
christopherdunn [Sat, 19 Apr 2014 21:41:03 +0000 (21:41 +0000)]
vim modeline

http://vim.wikia.com/wiki/Modeline_magic

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@279 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 months agoComment reading/write improvements
christopherdunn [Sat, 19 Apr 2014 21:19:24 +0000 (21:19 +0000)]
Comment reading/write improvements

This patch fixes some aspects of reading and writing comments:
- Multiple C++-style comments before a Json value had extra newlines appended to them. This patch removes the addition of those newlines.
- Comments written before Json values in the StyledWriter were not indented to match the indentation level of the value. This patch adds indentation to comments.
- Fixed inconsistency in newlines following C- and C++-style comments being saved as part of the comment. All newlines at the end of a comment are now removed.
- Added an additional test of comments.

https://sourceforge.net/p/jsoncpp/patches/25/

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@278 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 months agoJSON_ASSERT -> JSON_ASSERT_MESSAGE
christopherdunn [Sat, 19 Apr 2014 06:37:23 +0000 (06:37 +0000)]
JSON_ASSERT -> JSON_ASSERT_MESSAGE

This way, assertions can produce exceptions.
https://sourceforge.net/p/jsoncpp/bugs/67/

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@277 1f120ed1-78a5-a849-adca-83f0a9e25bb6

5 months agoAdded missing includes for std::istream.
aaronjacobs [Wed, 29 Jan 2014 00:13:38 +0000 (00:13 +0000)]
Added missing includes for std::istream.

Thanks to Quentin Fiard for the report.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@276 1f120ed1-78a5-a849-adca-83f0a9e25bb6

11 months agoFixed some snprintf-related build breakages in Visual Studio.
aaronjacobs [Thu, 8 Aug 2013 23:08:28 +0000 (23:08 +0000)]
Fixed some snprintf-related build breakages in Visual Studio.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@274 1f120ed1-78a5-a849-adca-83f0a9e25bb6

11 months agoReplaced the complex implementation of valueToString(double).
aaronjacobs [Thu, 8 Aug 2013 00:39:12 +0000 (00:39 +0000)]
Replaced the complex implementation of valueToString(double).

The previous one was confusing and prone to buffer overflows, and didn't
work correctly with 16-decimal-digit numbers. The new one simply uses
snprintf with a standard format string.

The major change is that we don't always print a decimal point now.
Fortunately, JSON doesn't distinguish between integers and reals.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@272 1f120ed1-78a5-a849-adca-83f0a9e25bb6

11 months agoSwitched away from sprintf, which is prone to buffer overflows.
aaronjacobs [Tue, 6 Aug 2013 23:12:56 +0000 (23:12 +0000)]
Switched away from sprintf, which is prone to buffer overflows.

Most reasonable platforms have this function. If you're here because
this broke the build for you, consider adding an ifdef for your platform
and using sprintf there (but not on other platforms).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@269 1f120ed1-78a5-a849-adca-83f0a9e25bb6

14 months ago- CMake: added option to turn fail compilation if warning occurs, and warning level...
blep [Thu, 9 May 2013 18:42:33 +0000 (18:42 +0000)]
- CMake: added option to turn fail compilation if warning occurs, and warning level 4 with MSVC.
- Fixed some warnings

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@268 1f120ed1-78a5-a849-adca-83f0a9e25bb6

14 months ago- New CMake based build system. Based in part on contribution from
blep [Wed, 8 May 2013 20:21:11 +0000 (20:21 +0000)]
- New CMake based build system. Based in part on contribution from
Igor Okulist and Damien Buhl (Patch #14). Added support for running
tests and building with DLL on Windows.
- added missing JSON_API
- Visual Studio DLL: suppressed warning "C4251: <data member>: <type>
needs to have dll-interface to be used by..." via pragma push/pop
in json-cpp headers.
- New header json/version.h now contains version number macros
(JSONCPP_VERSION_MAJOR, JSONCPP_VERSION_MINOR, JSONCPP_VERSION_PATCH
and JSONCPP_VERSION_HEXA). While this header is generated by CMake,
it is committed to ease build with alternate build system
(CMake only update the file when it changes avoid issues with VCS).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@256 1f120ed1-78a5-a849-adca-83f0a9e25bb6

15 months agoPatch #3600941: Missing field copy in Json::Value::iterator causing infinite loop...
blep [Fri, 12 Apr 2013 13:26:23 +0000 (13:26 +0000)]
Patch #3600941: Missing field copy in Json::Value::iterator causing infinite loop when using experimental internal map (#define JSON_VALUE_USE_INTERNAL_MAP) (contributed by Ming-Lin Kao).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@254 1f120ed1-78a5-a849-adca-83f0a9e25bb6

15 months agoPatch #3539678: Copy constructor does not initialize allocated_ for stringValue ...
blep [Fri, 12 Apr 2013 13:11:14 +0000 (13:11 +0000)]
Patch #3539678: Copy constructor does not initialize allocated_ for stringValue (contributed by rmongia).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@253 1f120ed1-78a5-a849-adca-83f0a9e25bb6

19 months agoFixed warning(error?) on #if testing value of _MSC_VER without checking that it was...
blep [Thu, 20 Dec 2012 10:08:50 +0000 (10:08 +0000)]
Fixed warning(error?) on #if testing value of _MSC_VER without checking that it was defined.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@251 1f120ed1-78a5-a849-adca-83f0a9e25bb6

2 years agoMade it possible to drop null placeholders from array output. git-svn
aaronjacobs [Mon, 12 Mar 2012 04:53:57 +0000 (04:53 +0000)]
Made it possible to drop null placeholders from array output.

This can be used when it's clear that the consumer is able to deal with
this, as web browsers are. Thanks to Yatin Chawathe for the patch.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@249 1f120ed1-78a5-a849-adca-83f0a9e25bb6

2 years agoGot rid of several unnecessary includes of <iostream>.
aaronjacobs [Thu, 22 Dec 2011 03:18:24 +0000 (03:18 +0000)]
Got rid of several unnecessary includes of <iostream>.

Including <iostream> causes the file to be polluted with a static
initializer for the __ioinit symbol. This can harm binary startup time.
For more info, see here:

    http://neugierig.org/software/chromium/notes/2011/08/static-initializers.html

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@247 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agobug#2407932: strpbrk() could fail for NULL pointer.
christopherdunn [Wed, 22 Jun 2011 21:04:41 +0000 (21:04 +0000)]
bug#2407932: strpbrk() could fail for NULL pointer.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@244 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agobug#3306345: minor typo in Path::resolve() -- missing bang.
christopherdunn [Wed, 22 Jun 2011 08:30:21 +0000 (08:30 +0000)]
bug#3306345: minor typo in Path::resolve() -- missing bang.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@243 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoMore missing constructor initializers found by Coverity.
christopherdunn [Tue, 21 Jun 2011 23:02:06 +0000 (23:02 +0000)]
More missing constructor initializers found by Coverity.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@241 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoAnother simple addition for constructor initialization, PathArgument.
christopherdunn [Tue, 21 Jun 2011 22:08:49 +0000 (22:08 +0000)]
Another simple addition for constructor initialization, PathArgument.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@240 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoSimple changes to Reader initialization, from Chromium folks. (I do not think this...
christopherdunn [Tue, 21 Jun 2011 21:56:54 +0000 (21:56 +0000)]
Simple changes to Reader initialization, from Chromium folks. (I do not think this was submitted as a bug.)

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@239 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed unit tests execution on MSVC 6 by removing usage of std::numeric_limits. It...
blep [Fri, 27 May 2011 08:12:41 +0000 (08:12 +0000)]
Fixed unit tests execution on MSVC 6 by removing usage of std::numeric_limits. It was returning 0 value in some max cases. Fixed Value::asFloat() to use integerToDouble().

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@235 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed compilation issues with MSVC 6: replace usage of ostringstream with valueToStri...
blep [Thu, 26 May 2011 22:55:24 +0000 (22:55 +0000)]
Fixed compilation issues with MSVC 6: replace usage of ostringstream with valueToString to support 64 bits integer and high precision floating point conversion to string. Replace usage of ULL and LL literal with UInt64(expr) and Int64(expr). Introduced helper function uint64ToDouble() to work-around missing conversion. Unit tests do not pass yet.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@234 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed unit test failure on IBM AIX xlC by hard-coding the maxUInt64AsDouble as double...
blep [Thu, 26 May 2011 17:14:26 +0000 (17:14 +0000)]
Fixed unit test failure on IBM AIX xlC by hard-coding the maxUInt64AsDouble as double constant instead of relying on double(Value::maxUInt64) which produces an incorrect value.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@232 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoAnother round of attempting to fix VC++ errors...
aaronjacobs [Thu, 26 May 2011 03:44:02 +0000 (03:44 +0000)]
Another round of attempting to fix VC++ errors...

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@228 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed more default cases.
aaronjacobs [Thu, 26 May 2011 03:32:11 +0000 (03:32 +0000)]
Fixed more default cases.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@227 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoGot rid of some unreachable code.
aaronjacobs [Thu, 26 May 2011 03:27:44 +0000 (03:27 +0000)]
Got rid of some unreachable code.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@226 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed a double -> float compilation warning/error.
aaronjacobs [Thu, 26 May 2011 03:04:01 +0000 (03:04 +0000)]
Fixed a double -> float compilation warning/error.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@225 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoReworked the type conversion system again, so that:A
aaronjacobs [Thu, 26 May 2011 02:46:28 +0000 (02:46 +0000)]
Reworked the type conversion system again, so that:A

 *  isFoo methods determine exact representability.
 *  asFoo methods cause casting when safe.
 *  isConvertibleTo indicates whether casting is safe.

See NEWS.txt for details.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@224 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoRemoved some out of date TODOs.
aaronjacobs [Wed, 25 May 2011 23:26:58 +0000 (23:26 +0000)]
Removed some out of date TODOs.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@221 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed a 'comparison between signed and unsigned' error.
aaronjacobs [Wed, 25 May 2011 05:50:13 +0000 (05:50 +0000)]
Fixed a 'comparison between signed and unsigned' error.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@219 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed a compilation warning/error.
aaronjacobs [Wed, 25 May 2011 04:34:57 +0000 (04:34 +0000)]
Fixed a compilation warning/error.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@217 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoGave a more consistent behavior to the Value::isFoo methods. See
aaronjacobs [Wed, 25 May 2011 04:19:17 +0000 (04:19 +0000)]
Gave a more consistent behavior to the Value::isFoo methods. See
NEWS.txt for more details.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@216 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed bugs in asInt64 and asUInt64.
aaronjacobs [Wed, 25 May 2011 03:16:49 +0000 (03:16 +0000)]
Fixed bugs in asInt64 and asUInt64.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@215 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed a "comparison between signed and unsigned" warning/error.
aaronjacobs [Tue, 24 May 2011 23:08:59 +0000 (23:08 +0000)]
Fixed a "comparison between signed and unsigned" warning/error.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@204 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed a parsing bug in decodeNumber, updating the failing test cases to be
aaronjacobs [Tue, 24 May 2011 03:59:24 +0000 (03:59 +0000)]
Fixed a parsing bug in decodeNumber, updating the failing test cases to be
correct in the process. (The test cases incorrectly used exact integers instead
of scientific notation.)

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@201 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed a bunch of compilation errors when JSON_HAS_INT64 is set.
aaronjacobs [Tue, 24 May 2011 03:18:02 +0000 (03:18 +0000)]
Fixed a bunch of compilation errors when JSON_HAS_INT64 is set.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@199 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoCentralized assertion macros and made them obey JSON_USE_EXCEPTION.
aaronjacobs [Tue, 24 May 2011 01:03:22 +0000 (01:03 +0000)]
Centralized assertion macros and made them obey JSON_USE_EXCEPTION.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@198 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoMade two security fixes.
aaronjacobs [Tue, 24 May 2011 00:43:59 +0000 (00:43 +0000)]
Made two security fixes.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@197 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoUpdated a cast to use a more appropriate type.
aaronjacobs [Tue, 24 May 2011 00:43:30 +0000 (00:43 +0000)]
Updated a cast to use a more appropriate type.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@196 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed constructor initializer list order warnings/errors.
aaronjacobs [Tue, 24 May 2011 00:42:58 +0000 (00:42 +0000)]
Fixed constructor initializer list order warnings/errors.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@195 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoRemoved an unused typedef.
aaronjacobs [Tue, 24 May 2011 00:42:15 +0000 (00:42 +0000)]
Removed an unused typedef.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@194 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed a hard to debug crash on OS X related to sscanf format strings.
aaronjacobs [Tue, 24 May 2011 00:41:12 +0000 (00:41 +0000)]
Fixed a hard to debug crash on OS X related to sscanf format strings.

See here for more info:
    http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@193 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed typo: amalga*ma*te. Replaced macro JSON_IS_AMALGATED with JSON_IS_AMALGAMATION
blep [Mon, 2 May 2011 21:09:30 +0000 (21:09 +0000)]
Fixed typo: amalga*ma*te. Replaced macro JSON_IS_AMALGATED with JSON_IS_AMALGAMATION

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@187 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoValue::compare() is now const and has an actual implementation with unit tests.
blep [Mon, 2 May 2011 20:11:48 +0000 (20:11 +0000)]
Value::compare() is now const and has an actual implementation with unit tests.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@186 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoUntabified some sources
blep [Mon, 2 May 2011 18:41:01 +0000 (18:41 +0000)]
Untabified some sources

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@185 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years ago- Added unit tests for comparison operators (except compare())
blep [Mon, 2 May 2011 16:53:10 +0000 (16:53 +0000)]
- Added unit tests for comparison operators (except compare())
- Fixed Value::operator <= implementation (had the semantic of operator >=). Found when addigin unit tests for comparison operators.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@184 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years ago- Bug #3200841: removed "warning C4127: conditional expression is constant" concernin...
blep [Mon, 2 May 2011 16:51:48 +0000 (16:51 +0000)]
- Bug #3200841: removed "warning C4127: conditional expression is constant" concerning infinite loop by replacing while (true) with for (;;). Added new JSON_FAIL macro. Commented unused parameters.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@183 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoBug #3200841: removed "warning C4127: conditional expression is constant" concerning...
blep [Mon, 2 May 2011 09:54:49 +0000 (09:54 +0000)]
Bug #3200841: removed "warning C4127: conditional expression is constant" concerning infinite loop by replacing while (true) with for (;;).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@182 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoAdded support for amalgated source and header generation (a la sqlite). Refer to...
blep [Sun, 1 May 2011 20:13:40 +0000 (20:13 +0000)]
Added support for amalgated source and header generation (a la sqlite). Refer to README.txt section "Generating amalgated source and header" for detail.

The amalgated sources are generated by concatenating JsonCpp source in the correct order and defining macro JSON_IS_AMALGATED to prevent inclusion of other headers. Sources and header has been modified to prevent any inclusion when this macro is defined.

The script amalgate.py handle the generation.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@165 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoRenamed Reader::getFormatedErrorMessages() to getFormattedErrorMessages. Bug #3023708...
blep [Sun, 1 May 2011 16:27:55 +0000 (16:27 +0000)]
Renamed Reader::getFormatedErrorMessages() to getFormattedErrorMessages. Bug #3023708 (Formatted has 2 't'). The old member function is deprecated but still present for backward compatibility.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@161 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed bug #3139678: stack buffer overflow when parsing a double with a length of...
blep [Sun, 1 May 2011 15:47:38 +0000 (15:47 +0000)]
Fixed bug #3139678: stack buffer overflow when parsing a double with a length of 32 characters.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@160 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoFixed bug #3139677: JSON [1 2 3] was incorrectly parsed as [1, 3]. Error is now corre...
blep [Sun, 1 May 2011 15:40:47 +0000 (15:40 +0000)]
Fixed bug #3139677: JSON [1 2 3] was incorrectly parsed as [1, 3]. Error is now correctly detected.

Modified runjsontests.py to allow test that expect failure in jsoncpp test suite.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@159 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoMajor rework of 64 integer support: 64 bits integer are only returned when explicitly...
blep [Mon, 27 Dec 2010 17:45:23 +0000 (17:45 +0000)]
Major rework of 64 integer support: 64 bits integer are only returned when explicitly request via Json::Value::asInt64(), unlike previous implementation where Json::Value::asInt() returned a 64 bits integer.

This eases porting portable code and does not break compatibility with the previous release.

Json::Value::asLargestInt() has also be added to ease writing portable code independent of 64 bits integer support. It is typically used to implement writers.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@156 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years agoAdded float Json::Value::asFloat() to obtain a floating point value as a float (avoid...
blep [Fri, 24 Dec 2010 19:30:06 +0000 (19:30 +0000)]
Added float Json::Value::asFloat() to obtain a floating point value as a float (avoid lost of precision warning caused by used of asDouble() to initialize a float).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@154 1f120ed1-78a5-a849-adca-83f0a9e25bb6

3 years ago- Array index can be passed as int to operator[], allowing use of literal:
blep [Fri, 24 Dec 2010 12:47:14 +0000 (12:47 +0000)]
- Array index can be passed as int to operator[], allowing use of literal:
  Json::Value array;
  array.append( 1234 );
  int value = array[0].asInt();  // did not compile previously

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@153 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoJsonCpp is now licensed under MIT license, or public domain if desired and recognized...
blep [Tue, 20 Apr 2010 21:35:19 +0000 (21:35 +0000)]
JsonCpp is now licensed under MIT license, or public domain if desired and recognized in your jurisdiction.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@150 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years ago- Moved definition of Json::Int and Json::UInt to config.h which compiler detection...
blep [Mon, 19 Apr 2010 07:37:41 +0000 (07:37 +0000)]
- Moved definition of Json::Int and Json::UInt to config.h which compiler detection logic to define them to 64 bits integer if JSON_NO_INT64 is not defined.
- Added Json::ArrayIndex as an unsigned int to forwards.h
- Modified Json::Value to consistently use Json::ArrayIndex.
- Added int/unsigned int constructor overload to Json::Value to avoid ambiguous constructor call.
- Modified jsontestrunner/main.cpp to use Json::valueToString for Value::asInt() conversion to string.
- Modified Json::Reader to only overflow to double when the number is too large (previous code relied on the fact that an int fitted in a double without precision loss).
- Generalized uintToString() helpers and buffer size to automatically adapt to the precision of Json::UInt.
- Added specific conversion logic for UInt to double conversion on Microsoft Visual Studio 6 which only support __int64 to double conversion (unsigned __int64 conversion is not supported)
- Added test for 64 bits parsing/writing. Notes: those will fail when compiled with JSON_NO_INT64 (more dev required to adapt).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@149 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoRemoved experimental ValueAllocator, it caused static initialization/destruction...
blep [Sat, 13 Mar 2010 13:10:27 +0000 (13:10 +0000)]
Removed experimental ValueAllocator, it caused static initialization/destruction order issues (bug #2934500). The DefaultValueAllocator has been inlined in code.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@146 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years ago- extracted some utility functions out-of reader and parser.
blep [Sat, 13 Mar 2010 12:24:38 +0000 (12:24 +0000)]
- extracted some utility functions out-of reader and parser.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@145 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years ago- added Int/UInt typedef in Json namespace. Modified Value::Int and Value::UInt to...
blep [Sun, 21 Feb 2010 14:08:17 +0000 (14:08 +0000)]
- added Int/UInt typedef in Json namespace. Modified Value::Int and Value::UInt to be typedef on those. Modified code to use Json::Int instead of Value::Int.
- added Value constructor taking begin/end pointer to initialize the Value with a non-zero terminated string.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@95 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoIntegrated part of Patch #2839016, fixing default iterator initialization when using...
blep [Fri, 15 Jan 2010 14:56:59 +0000 (14:56 +0000)]
Integrated part of Patch #2839016, fixing default iterator initialization when using internal map.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@91 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoFixed compilation with Sun Studio 12 (avoid usage of std::distance)
blep [Tue, 24 Nov 2009 17:43:58 +0000 (17:43 +0000)]
Fixed compilation with Sun Studio 12 (avoid usage of std::distance)

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@89 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoFixed iteration bug over null values.
blep [Mon, 23 Nov 2009 22:33:30 +0000 (22:33 +0000)]
Fixed iteration bug over null values.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@88 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoFixed compilation issue with vs2005
blep [Thu, 19 Nov 2009 19:13:18 +0000 (19:13 +0000)]
Fixed compilation issue with vs2005

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@83 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoMoved Visual Studio projects file under makefiles/vs71 to allow usage of multiple...
blep [Thu, 19 Nov 2009 13:29:25 +0000 (13:29 +0000)]
Moved Visual Studio projects file under makefiles/vs71 to allow usage of multiple versions on the same source tree.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@81 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoFixed comment after value in object value signaled by Frederic Surleau.
blep [Wed, 18 Nov 2009 22:25:34 +0000 (22:25 +0000)]
Fixed comment after value in object value signaled by Frederic Surleau.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@77 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years ago- added Features class that describes allowed extension for Reader, to allow for...
blep [Wed, 18 Nov 2009 21:38:54 +0000 (21:38 +0000)]
- added Features class that describes allowed extension for Reader, to allow for strict configuration
- added tests from json.org jsonchecker and modified jsontestrunner to use strict parsing mode when executing them

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@76 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoFixing string index issue when checking for control characters
malays [Wed, 18 Nov 2009 17:40:22 +0000 (17:40 +0000)]
Fixing string index issue when checking for control characters

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@74 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoFixed default constructor initialization.
blep [Wed, 18 Nov 2009 17:12:24 +0000 (17:12 +0000)]
Fixed default constructor initialization.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@73 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoFixed bug introduced by utf-8 patch with fix provided by Henry Ludemann. All unit...
blep [Wed, 18 Nov 2009 17:01:09 +0000 (17:01 +0000)]
Fixed bug introduced by utf-8 patch with fix provided by Henry Ludemann. All unit tests are now passing.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@72 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoAdded patch for mingw from Sebastien Vincent
blep [Sun, 15 Nov 2009 22:49:54 +0000 (22:49 +0000)]
Added patch for mingw from Sebastien Vincent

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@71 1f120ed1-78a5-a849-adca-83f0a9e25bb6

4 years agoImplementing support for reading and writing Unicode escape sequences.
malays [Fri, 13 Nov 2009 04:21:14 +0000 (04:21 +0000)]
Implementing support for reading and writing Unicode escape sequences.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@70 1f120ed1-78a5-a849-adca-83f0a9e25bb6

5 years agoAdded cstring for memcpy(), as suggested by sebastien.vincent@turnserver.org . This...
christopherdunn [Mon, 11 May 2009 20:04:10 +0000 (20:04 +0000)]
Added cstring for memcpy(), as suggested by sebastien.vincent@turnserver.org .  This allows gcc-4 to compile.  Removed doxygen from SConstruct, since it is now broken; I have been unable to get it to work with either scons 0.97 or scons 2.1; hopefully someone else can get that working again.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@68 1f120ed1-78a5-a849-adca-83f0a9e25bb6

6 years agoForgot to add # to %g modifier for sprintf in valueToString for floats. Otherwise...
christopherdunn [Thu, 24 Jan 2008 20:21:11 +0000 (20:21 +0000)]
Forgot to add # to %g modifier for sprintf in valueToString for floats.  Otherwise no decimal point appears when only zeroes would follow, which changes the type to integer.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@66 1f120ed1-78a5-a849-adca-83f0a9e25bb6

6 years agoChanged valueToString for floats so that zeroes after a decimal are truncated --...
christopherdunn [Thu, 24 Jan 2008 20:09:48 +0000 (20:09 +0000)]
Changed valueToString for floats so that zeroes after a decimal are truncated -- saves file size esp. for StyledStreamWriter which uses tabs instead of spaces.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@65 1f120ed1-78a5-a849-adca-83f0a9e25bb6

6 years agoFixed compilation issue on windows (avoid using cstring and use string.h instead).
blep [Sun, 20 Jan 2008 16:55:26 +0000 (16:55 +0000)]
Fixed compilation issue on windows (avoid using cstring and use string.h instead).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@63 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoIndentation is not perfect, but pretty good. Not sure how to perfect, given the...
christopherdunn [Wed, 13 Jun 2007 17:02:01 +0000 (17:02 +0000)]
Indentation is not perfect, but pretty good.  Not sure how to perfect, given the difficulty of testing the last char written.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@50 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoAdded StyledStreamWriter, which has no reason to derive from Writer, since its write...
christopherdunn [Wed, 13 Jun 2007 15:55:50 +0000 (15:55 +0000)]
Added StyledStreamWriter, which has no reason to derive from Writer, since its write() method does cannot return a string and must take a stream.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@49 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoAdded prop svn:eol-style native. Stripped carriage-returns on unix. Hopefully, this...
christopherdunn [Wed, 13 Jun 2007 15:52:48 +0000 (15:52 +0000)]
Added prop svn:eol-style native. Stripped carriage-returns on unix.  Hopefully, this will work for Windows too now.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@48 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoAdded prop svn:eol-style native. Stripped carriage-returns on unix. Hopefully, this...
christopherdunn [Wed, 13 Jun 2007 15:48:30 +0000 (15:48 +0000)]
Added prop svn:eol-style native. Stripped carriage-returns on unix.  Hopefully, this will work for Windows too now.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@46 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoFixed compilation warnings. Added -Wall to linux-gcc compilation. JSON_ASSERT_MESSA...
christopherdunn [Wed, 9 May 2007 19:35:15 +0000 (19:35 +0000)]
Fixed compilation warnings.  Added -Wall to linux-gcc compilation.  JSON_ASSERT_MESSAGE now throws exception (but JSON_ASSERT does not).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@45 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoFixed 2.95.3 header probs
christopherdunn [Fri, 23 Mar 2007 10:19:49 +0000 (10:19 +0000)]
Fixed 2.95.3 header probs

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@43 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoAdded istream/ostream funcs/operators
christopherdunn [Fri, 23 Mar 2007 09:57:01 +0000 (09:57 +0000)]
Added istream/ostream funcs/operators

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@42 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoRenamed buildLibary to buildLibrary and added SharedLibrary rule.
christopherdunn [Fri, 23 Mar 2007 08:57:57 +0000 (08:57 +0000)]
Renamed buildLibary to buildLibrary and added SharedLibrary rule.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@41 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoAdded empty() operator-bang and isNull()
christopherdunn [Fri, 23 Mar 2007 08:55:25 +0000 (08:55 +0000)]
Added empty() operator-bang and isNull()

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@40 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoAdded removeMember() and altered a few comments.
christopherdunn [Fri, 23 Mar 2007 08:30:20 +0000 (08:30 +0000)]
Added removeMember() and altered a few comments.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@39 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agofixed compiler warning
christopherdunn [Fri, 23 Mar 2007 07:16:59 +0000 (07:16 +0000)]
fixed compiler warning

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@37 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agosetComment() will assert if comment does not start with / (or if it were NULL, which...
christopherdunn [Fri, 23 Mar 2007 07:05:19 +0000 (07:05 +0000)]
setComment() will assert if comment does not start with / (or if it were NULL, which would have seg-faulted before).

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@36 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years ago[1611376]by reserving the max string-size when escaped chars exist, we should save...
christopherdunn [Fri, 23 Mar 2007 06:12:28 +0000 (06:12 +0000)]
[1611376]by reserving the max string-size when escaped chars exist, we should save some runtime.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@34 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years ago[1611376]writer now escapes special characters. When no special chars are present...
christopherdunn [Fri, 23 Mar 2007 05:56:39 +0000 (05:56 +0000)]
[1611376]writer now escapes special characters.  When no special chars are present, old behavior is retained.  New method might have a performance penalty b/c of operator new inside std::string.  (This would not exist if the whole thing operated on ostream instead, I think.)

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@33 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years ago[1587188]Fixed parsing of comment at tail of object.
christopherdunn [Fri, 23 Mar 2007 05:04:38 +0000 (05:04 +0000)]
[1587188]Fixed parsing of comment at tail of object.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@32 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years agoFixed gcc 2.95.3 problem. Bug: 1570919
christopherdunn [Fri, 23 Mar 2007 04:55:07 +0000 (04:55 +0000)]
Fixed gcc 2.95.3 problem.  Bug: 1570919

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@31 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years ago- Made FastWriter output more compact.
blep [Sat, 17 Mar 2007 22:14:59 +0000 (22:14 +0000)]
- Made FastWriter output more compact.
- fixed bug in runjsontests.py script.

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@29 1f120ed1-78a5-a849-adca-83f0a9e25bb6

7 years ago- reorganized repository to match standard layout
blep [Thu, 15 Mar 2007 22:11:38 +0000 (22:11 +0000)]
- reorganized repository to match standard layout

git-svn-id: http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk/jsoncpp/src/lib_json@28 1f120ed1-78a5-a849-adca-83f0a9e25bb6