184 Commits

Author SHA1 Message Date
Christopher Dunn
25342bac13 support UTF-8 for const methods 2015-03-03 00:14:53 -06:00
Christopher Dunn
8a77037320 actually store length in CZString 2015-03-02 23:50:59 -06:00
Christopher Dunn
57ad051f67 allow length in CZString 2015-03-02 23:50:59 -06:00
Christopher Dunn
4788764844 drop JSON_VALUE_USE_INTERNAL_MAP, JSON_USE_SIMPLE_INTERNAL_ALLOCATOR
And remove some old headers.

These were not actually compiling anymore, and there were outstanding,
known bugs, e.g. https://sourceforge.net/p/jsoncpp/bugs/27
2015-02-25 10:04:13 -06:00
Christopher Dunn
0c66e698fb allowSingleQuotes
issue #182
2015-02-24 15:49:45 -06:00
Christopher Dunn
f9db82af17 1.4.4 < 1.4.3
* fixed Readers when `allowDropNullPlaceholders`
2015-02-19 15:37:57 -06:00
Christopher Dunn
30d923f155 1.4.3 <- 1.4.2 2015-02-18 09:20:28 -06:00
Kobi Gurkan
09b8670536 only throws exceptions JSON_USE_EXCEPTION
JSON_ASSERT now throws a runtime_error
2015-02-15 18:00:31 +02:00
Christopher Dunn
3bfd215938 1.4.2 < 1.4.1
* Bug-fix for ValueIterator::operator-() (issue #169)
2015-02-15 02:49:34 -06:00
Kevin Grant
4c5832a0be Fix bug in ValueIteratorBase::operator- 2015-02-15 02:38:31 -06:00
Christopher Dunn
e7233bf056 1.4.1 <- 1.4.0 2015-02-13 10:00:38 -06:00
Christopher Dunn
f4be815c86 failIfExtra
1. failing regression tests, from #164 and #107
2. implemented; tests pass
3. allow trailing comments
2015-02-13 09:39:08 -06:00
Christopher Dunn
aa13a8ba40 comments/minor typos 2015-02-13 09:38:49 -06:00
Christopher Dunn
249ad9f47f stackLimit 2015-02-11 10:01:58 -06:00
Christopher Dunn
29501c4d9f clarify comments
And throw instead of return null for invalid settings.
2015-02-10 23:03:27 -06:00
Christopher Dunn
20d09676c2 drop experimental OldCompressingStreamWriterBuilder 2015-02-10 21:29:35 -06:00
Christopher Dunn
5a744708fc enableYAMLCompatibility and dropNullPlaceholders for StreamWriterBuilder 2015-02-10 21:28:13 -06:00
Christopher Dunn
07f0e9308d nullRef, since we had to add that kludge to 0.8.0 2015-02-10 21:28:13 -06:00
Christopher Dunn
db75cdf21e mv CommentStyle to .cpp 2015-02-09 18:54:58 -06:00
Christopher Dunn
c41609b9f9 set output stream in write(), not in builder 2015-02-09 18:44:53 -06:00
Christopher Dunn
f757c18ca0 add all features 2015-02-09 18:24:56 -06:00
Christopher Dunn
3cf9175bde remark defaults via doxygen snippet 2015-02-09 18:16:24 -06:00
Christopher Dunn
a9e1ab302d Builder::settings_
We use Json::Value to configure the builders so we can maintain
binary-compatibility easily.
2015-02-09 17:30:11 -06:00
Christopher Dunn
694dbcb328 update docs, writeString() 2015-02-09 15:25:57 -06:00
Christopher Dunn
1357cddf1e deprecate Builders
see issue #131
2015-02-09 11:46:27 -06:00
Christopher Dunn
8df98f6112 deprecate old Reader; separate Advanced Usage section 2015-02-09 11:15:39 -06:00
Christopher Dunn
6451412c99 simplify basic docs 2015-02-09 09:44:26 -06:00
Christopher Dunn
66a8ba255f clarify Builders 2015-02-09 01:29:43 -06:00
Christopher Dunn
2c1197c2c8 CharReader/Builder
* CharReaderBuilder is similar to StreamWriterBuilder.
* use rdbuf(), since getline(string) is not required to handle EOF as delimiter
2015-02-08 13:22:09 -06:00
Christopher Dunn
198cc350c5 drop scoped enum, for pre-C++11 compatibility 2015-01-29 13:49:21 -06:00
Christopher Dunn
38042b3892 docs 2015-01-26 11:38:38 -06:00
Christopher Dunn
7eca3b4e88 gcc-4.6 (Travis CI) does not support 2015-01-26 11:17:42 -06:00
Christopher Dunn
999f5912f0 docs 2015-01-26 11:12:53 -06:00
Christopher Dunn
6065a1c142 make StreamWriterBuilder concrete 2015-01-26 11:01:15 -06:00
Christopher Dunn
28a20917b0 Move old FastWriter stuff out of new Builder 2015-01-26 10:47:42 -06:00
Christopher Dunn
177b7b8f22 OldCompressingStreamWriterBuilder 2015-01-26 10:44:20 -06:00
Christopher Dunn
9da9f84903 improve docs
including `writeString()`
2015-01-26 10:43:53 -06:00
Christopher Dunn
c7b39c2e25 deprecate old Writers
also, use withers instead of setters, and update docs
2015-01-25 18:45:59 -06:00
Christopher Dunn
d78caa3851 implement strange setting from FastWriter 2015-01-25 18:15:54 -06:00
Christopher Dunn
648843d148 clarify CommentStyle 2015-01-25 15:54:40 -06:00
Christopher Dunn
fe3979cd8a drop StreamWriterBuilderFactory, for now 2015-01-25 15:54:40 -06:00
Christopher Dunn
9243d602fe const stuff 2015-01-25 15:54:40 -06:00
Christopher Dunn
beb6f35c63 non-const write 2015-01-25 15:54:40 -06:00
Christopher Dunn
77ce057f14 fix comment 2015-01-25 15:54:40 -06:00
Christopher Dunn
4d649402b0 setIndentation() 2015-01-25 15:54:40 -06:00
Christopher Dunn
489707ff60 StreamWriter::Builder 2015-01-25 15:54:39 -06:00
Christopher Dunn
5fbfe3cdb9 StreamWriter 2015-01-25 15:54:39 -06:00
Christopher Dunn
1e3149ab75 rm trailing newlines for *all* comments
This will make it easier to fix newlines consistently.
2015-01-25 14:32:13 -06:00
Christopher Dunn
2bc6137ada fix gcc warnings 2015-01-24 13:42:37 -06:00
Christopher Dunn
d383056fbb avoid extra newlines in StyledStreamWriter
Add indented_ as a bitfield. (Verified that sizeof(StyledStreamWriter)
remains 96 for binary compatibility. But the new symbol requires a minor
version-bump.)
2015-01-23 14:23:31 -06:00
Christopher Dunn
f8ca6cbb25 1.4.0 <- 1.3.0
Minor version bump, but we will wait for a few more commits this time
before tagging the release.
2015-01-23 14:23:31 -06:00
Christopher Dunn
9132aa94b1 1.3.0
http://apr.apache.org/versioning.html#binary
2015-01-22 19:25:44 -06:00
Christopher Dunn
76746b09fc deprecate old removeMember() 2015-01-22 19:25:44 -06:00
Christopher Dunn
e87e41cdb0 from Itzik S; see issue #28
with minor corrections
2015-01-20 17:03:58 -06:00
Christopher Dunn
9de2c2d84d partial 2015-01-20 17:02:48 -06:00
Christopher Dunn
7956ccd61e allow stream ops for JSON_FAIL_MESSAGE
http://www.iar.com/Global/Resources/Developers_Toolbox/C_Cplusplus_Programming/Tips%20and%20tricks%20using%20the%20preprocessor%20%28part%20two%29.pdf
2015-01-20 16:25:26 -06:00
datadiode
9454e687a3 Specialize std::swap() for Json::Value in a C++ standard compliant way
originally from pull #119
2015-01-20 15:25:41 -06:00
Christopher Dunn
51c0afab22 1.2.1 <- 1.2.0
This can affect existing round-trip tests, but we never made any
guarantees about whitespace constancy.
2015-01-20 15:12:49 -06:00
Christopher Dunn
2cd0f4ec21 1.2.0 <- 1.1.1
`operator=()` (which already performed a deep-copy) now includes
comments. The change is probably harmless in all practical cases.
2015-01-20 12:44:51 -06:00
Christopher Dunn
66eb72f121 use SwapPayload() to retain comments
All tests pass, but we might be missing coverage.

issue #47
2015-01-20 12:07:01 -06:00
datadiode
c07ef37904 https://github.com/open-source-parsers/jsoncpp/issues/47 2015-01-18 10:05:25 +01:00
datadiode
09d352ac13 Remove unused functions 2015-01-17 13:26:23 +01:00
Christopher Dunn
4997dfb8af 1.1.1 <- 1.1.0
slight change to fail on a bad float
2015-01-16 15:09:54 -06:00
Christopher Dunn
8b489f891a 1.1.0 <- 1.0.0 2015-01-06 12:46:17 -06:00
Christopher Dunn
7165f6ac4c 1.0.0 2014-11-20 08:45:58 -06:00
Billy Donahue
8eb5d89db6 Remove initInt and initUInt until they are needed. 2014-11-10 01:35:42 -05:00
Yu Xiaolei
1c3a20de50 Allow customization of component install dirs 2014-11-05 11:25:53 +08:00
Mara Kim
b84a39cae5 Add public semantic error reporting
Closes open-source-parsers/jsoncpp#57
2014-10-23 02:18:14 -05:00
Christopher Dunn
0375af2eb5 drop version qualifier
This should help keep version.h stable.

    x.y.z-dev
    => major, minor, patch, qual
    == x, y, z, -dev

But we do not need -dev anymore.
2014-09-18 16:43:07 -07:00
Aaron Jacobs
ba330893d7 Ran clang-format again, this time hitting .inl files too.
clang-format -i $(find . -name '*.h' -or -name '*.cpp' -or -name '*.inl')
2014-09-18 16:33:49 -07:00
Christopher Dunn
4bceabf2f9 ws autogen 2014-09-16 19:11:20 -07:00
Aaron Jacobs
11086dd6a7 Enabled PointerBindsToType in clang-format options. 2014-09-15 10:15:29 +10:00
Aaron Jacobs
30b07c0275 Ran clang-format over all .h and .cpp files.
clang-format -i $(find . -name '*.h' -or -name '*.cpp')
2014-09-15 10:14:48 +10:00
Braden McDorman
540db3b052 Added arrow operator to ValueIterator and ValueConstIterator 2014-09-14 08:15:47 -07:00
Christopher Dunn
f4b06cd607 rm trailing ws 2014-09-14 08:15:32 -07:00
Christopher Dunn
b061ff4a1e generated for the last time, maybe 2014-09-11 10:04:49 -07:00
Billy Donahue
45cd9490cd Switch to copy-and-swap idiom for operator=.
This allows the compiler to elide a copy when rhs is a temporary.
2014-09-10 10:37:34 -07:00
Don Milham
5bf16105b5 added option to FastWriter which omits the trailing new line character 2014-09-02 17:09:07 -06:00
Christopher Dunn
f3989977c0 rm generated version.h 2014-07-09 21:48:49 -07:00
Christopher Dunn
60f778b9fc relative include 2014-07-09 21:40:23 -07:00
Christopher Dunn
06dcb1fc89 cmake updates this 2014-07-08 21:57:12 -07:00
Christopher Dunn
28836b8acc fix bug for static init
Ugh! Static initialization of instance variables is a very bad idea.

This fix is taken from the Chromium code-base. It includes their
double-fix for ARM.

* https://codereview.chromium.org/24984004
* https://src.chromium.org/viewvc/chrome?revision=226099&view=revision
* https://code.google.com/p/webrtc/issues/detail?id=1777
2014-07-05 17:36:20 -07:00
Aaron Jacobs
3a0c4fcc82 Ran clang-format again. 2014-07-01 09:20:48 +10:00
Aaron Jacobs
9fa4e849a1 Ran clang-format over all .h and .cpp files.
clang-format -i $(find . -name '*.h' -or -name '*.cpp')
2014-07-01 08:48:54 +10:00
Christopher Dunn
6764059395 fix stdexcept
https://sourceforge.net/p/jsoncpp/bugs/68/
2014-05-13 09:49:25 +00:00
Aaron Jacobs
68db655347 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.
2014-04-23 23:41:12 +00:00
Aaron Jacobs
642befc836 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/
2014-04-23 23:28:23 +00:00
Aaron Jacobs
94d17e9fdf Added missing includes for std::istream.
Thanks to Quentin Fiard for the report.
2014-01-29 00:13:38 +00:00
Baptiste Lepilleur
7b62ceacee - disabled warning 4786 for VS6 caused by STL (identifier was truncated to '255' characters in the debug information)
- added batchbuild config for XP VM
2013-05-09 16:24:13 +00:00
Baptiste Lepilleur
eafd702a17 - 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).
2013-05-08 20:21:11 +00:00
Baptiste Lepilleur
a8afdd40af - Patch #3393345: BOOST_FOREACH compatibility. Made Json::iterator more standard compliant, added missing iterator_category and value_type typedefs (contribued by Robert A. Iannucci).
- Patch #3474563: added missing JSON_API on some classes causing link issues when building as a dynamic library on Windows (contributed by Francis Bolduc).
2013-04-12 14:10:13 +00:00
Aaron Jacobs
ae3c7a7aab 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.
2012-03-12 04:53:57 +00:00
Aaron Jacobs
f572e8e42e Added an exit() to JSON_FAIL_MESSAGE to fix "no return" errors. 2012-01-08 23:49:55 +00:00
Aaron Jacobs
2b853c4067 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
2011-12-22 03:18:24 +00:00
Aaron Jacobs
7c507d7eba Made JSON_USE_EXCEPTION's value in config.h a default that can be overridden.
This allows users to override it with their compiler invocation. For example:

    g++ -D JSON_USE_EXCEPTION=0 ...
2011-09-14 08:41:37 +00:00
Aaron Jacobs
7b5edd9859 Added line breaks to make error messages easier to read. 2011-05-25 04:59:57 +00:00
Aaron Jacobs
1b138e8544 Gave a more consistent behavior to the Value::isFoo methods. See
NEWS.txt for more details.
2011-05-25 04:19:17 +00:00
Aaron Jacobs
a761530f14 Fixed a missing include error. 2011-05-24 06:27:36 +00:00
Aaron Jacobs
f1053e7acb Fixed a bunch of compilation errors when JSON_HAS_INT64 is set. 2011-05-24 03:18:02 +00:00
Aaron Jacobs
e3d0eca9f4 Centralized assertion macros and made them obey JSON_USE_EXCEPTION. 2011-05-24 01:03:22 +00:00