1236 Commits

Author SHA1 Message Date
Billy Donahue
1d95628ba8
Remove std::swap<Json::Value> in favor of ADL
Comply with http://en.cppreference.com/w/cpp/concept/Swappable
Don't open namespace std.
2018-03-06 12:51:58 -05:00
Christopher Dunn
3e2b8ea9cc
Minor changes for static analysis (#749)
re: #747
2018-03-03 12:51:17 -06:00
Christopher Dunn
1ab310e3ed
Merge pull request #748 from dueringa/feature/clarifyIndentDocumentation
Clarify documentation regarding indentation / newline
2018-03-03 09:46:36 -06:00
uvok cheetah
c7728e8658 Clarify documentation regarding indentation / newline 2018-03-03 12:45:54 +01:00
Christopher Dunn
313a0e4c34
Merge pull request #743 from tjanc/tjanc/fix-utf8-codepoint
Incorrect byte shift when interpreting 32-bit utf-8 codepoints
2018-02-14 10:33:35 -06:00
Thomas Jandecka
592d942b3b fix: byte shift when interpreting 32-bit utf-8 codepoints 2018-02-14 14:23:58 +01:00
luzpaz
5b45aa55ca Misc-typos (#741)
Found in downstream CMake repo via `codespell -q 3`
2018-02-08 19:05:50 -06:00
Christopher Dunn
07a324fb14
Merge pull request #736 from maxim-ky/master
Move the existing value to "removed" argument; removed is optional (could be nullptr)
2018-01-29 21:13:47 -06:00
Maxim Ky
1ec85c76a4 Value::removeMember arg "removed" is optional now (could be nullptr) 2018-01-29 16:59:24 +03:00
Maxim Ky
c27936e0aa Value::removeMember moves the existing value to "removed" now 2018-01-29 16:58:45 +03:00
drgler
04abe38148 Issue #731: Provide new JSONCPP_OP_EXPLICIT macro to restore VS 2012 support after recent introduction of explicit conversion function in JSON::Value. 2018-01-20 15:38:39 -06:00
Christof Krüger
edb4bdb7ec Do not deprecate whole class but only constructors of Json::Reader.
This should fix warning C4996 issued by Visual Studio in cases where
Json::Reader is not even used by client code.
2018-01-20 15:32:22 -06:00
Christopher Dunn
0ced843c97
Merge pull request #726 from okodron/fix-704
Value::copy() creates a deep copy now
2018-01-20 15:27:46 -06:00
Andrey Okoshkin
9b569c8ce3 Make Value copy constructor simplier
Helper private methods Value::dupPayload() and Value::dupMeta() are added.
Value copy constructor doesn't attempt to delete its data first.
* Value::dupPayload() duplicates a payload.
* Value::dupMeta() duplicates comments and an offset position with a limit.
2018-01-12 15:59:20 +03:00
Andrey Okoshkin
392e3a5b49 Add basic test for Value::copy() (#704) 2018-01-12 14:36:01 +03:00
Andrey Okoshkin
c69148c946 Fix Value::copyPayload() and Value::copy() (#704)
Value copy constructor shares the same code with Value::copy() and Value::copyPayload().
New Value::releasePayload() is used to free payload memory.
Fixes: #704
2018-01-12 14:33:47 +03:00
Christopher Dunn
2f227cb122
Merge pull request #718 from dbeurle/master
CZString as public when using NVCC, see issue #486
2017-12-22 23:19:07 -06:00
Darcy Beurle
798f6ba055
CZString as public when using NVCC, see issue #486 2017-12-22 22:48:20 +01:00
Christopher Dunn
72f6cc7fd0
Merge pull request #716 from cdunn2001/master
Speed up TravisCI build
2017-12-21 02:33:50 -06:00
Christopher Dunn
d3ce75c74e pyenv global 3.6
We need pip3, and TravisCI build error says:

    The `pip3` command exists in these Python versions: 3.6, 3.6.3
2017-12-21 02:05:52 -06:00
Christopher Dunn
de5fb8e022 Try to use default python on Trusty, for speed
Running `pyenv install` wastes about 3 minutes.

* https://docs.travis-ci.com/user/languages/python

    "for Trusty, this means 2.7.6 and 3.4.3"
2017-12-21 01:27:38 -06:00
Christopher Dunn
899894f0f5
-std=c++11 (#715)
We set this is the Meson build to eliminate warnings, but
c++0x should still work, at least for now.

See #695 for discussion.
2017-12-21 01:22:40 -06:00
Christopher Dunn
ddabf50f72 1.8.4; soversion=20 1.8.4 2017-12-20 15:07:10 -06:00
Christopher Dunn
63ab03ca28
replace code point in range(0xD800, 0xDFFF) to replacement mark (#714)
closes #712
2017-12-20 14:43:55 -06:00
Christopher Dunn
41ff85f443
pyenv install (#713)
```
Unfortunately, since our latest image update, Python 3.5 doesn't come pre-installed anymore. Hence, you will have to install it via `pyenv` as a first step e.g.

before_install
  - pyenv install 3.5.0 && pyenv global 3.5.0

support@travis-ci.com
```
2017-12-20 14:24:51 -06:00
Wolfram Rösler
9079422ac1 Allow Json::Value to be used in a boolean context (#695)
Must bump soversion too.
2017-12-05 11:18:55 -06:00
Christopher Dunn
c39aa295e4
Merge pull request #707 from remyjette/valuetostring-sign-mismatch
Fix sign mismatch in `valueToString`
2017-12-04 20:02:47 -06:00
Remy Jette
42ca02b833
Fix sign mismatch in valueToString
`valueToString` takes an argument `unsigned int precision`, but it is used with `%d` rather than `%u` in the `snprintf` format string. Make the format string look for an unsigned value instead.
2017-12-04 17:49:36 -08:00
Josh Soref
e6a588a246 Spelling (#703) 2017-12-03 10:54:29 -06:00
Sascha Zelzer
7c979e8661 Suppress implicit-fallthrough warnings from GCC 7 (#697)
GCC 7, when compiling with -Wimplicit-fallthrough=1 or higher, issues a warning which can be suppressed using a comment that matches certain regular expressions. The comment change does just that: signal to GCC that the fall through is intentional.

Fixes #676
2017-11-16 13:13:55 -06:00
Christopher Dunn
c469326b47
Merge pull request #699 from MarcelRaad/msvc_warnings
MSVC warning fixes in tests
2017-11-16 13:08:39 -06:00
Marcel Raad
240c85a10c
MSVC warning fixes in tests
- only use "#pragma GCC" on GCC-compatible compilers
- suppress deprecation warnings also on MSVC
2017-11-10 11:00:40 +01:00
Christopher Dunn
d61cddedac rm unused func 2017-10-29 23:45:01 -05:00
Brian W. Mulligan
5a2dc7a2ad Add comment to README giving instructions on how to install to a directory other than /usr/local (#694) 2017-10-18 00:20:45 -05:00
Wolfram Rösler
a06b390187 Un-deprecate removeMember overloads, return void (#693)
* Un-deprecate removeMember overloads, return void

Sometimes we just want to remove something we don't need anymore. Having
to supply a return buffer for the removeMember function to return something
we don't care about is a nuisance. There are removeMember overloads that
don't need a return buffer but they are deprecated. This commit un-deprecates
these overloads and modifies them to return nothing (void) instead of the
object that was removed.

Further discussion: https://github.com/open-source-parsers/jsoncpp/pull/689

WARNING: Changes the return type of the formerly deprecated removeMember
overloads from Value to void. May break existing client code.

* Minor stylistic fixes

Don't explicitly return a void value from a void function. Also, convert
size_t to unsigned in the CZString ctor to avoid a compiler warning.
2017-10-18 00:19:27 -05:00
Paweł Kierski
42a161fc80 Serialize UTF-8 string with Unicode escapes (#687)
Squashed and merged.
2017-10-03 18:19:20 -07:00
Christopher Dunn
a3a4059367 Use non-deprecated removeMember()
closes #683
2017-09-30 00:46:15 -05:00
Christopher Dunn
4d587638af Merge pull request #679 from hughbe/clang-warnings
Fix unknown pragma warnings with clang
2017-09-17 02:56:21 -05:00
Christopher Dunn
75e0c39393 Merge pull request #680 from jasonszang/master
Fix meson.build to allow using jsoncpp as a subproject
2017-09-17 02:54:43 -05:00
Jason S Zang
43fd41d1fc Fix meson.build to allow using jsoncpp as a subproject 2017-09-16 11:19:30 +01:00
Hugh Bellamy
7287065b63 Fix unknown pragma warnings with clang 2017-09-16 10:01:09 +01:00
Christopher Dunn
9249878229 Merge pull request #678 from open-source-parsers/append-move
fixes #677
2017-09-15 19:15:50 -05:00
Christopher Dunn
17c14e73a9 Use move ctor in append() 2017-09-15 18:55:50 -05:00
Christopher Dunn
21e133c6fb Merge pull request #675 from wolframroesler/patch-1
closes #671
2017-09-15 01:11:24 -05:00
Wolfram Rösler
ff6b449a07 Add value_type to improve integration with boost
Without value_type, Boost.Test version 1.65.0 throws a compiler error when a Json::Value object is compared to another with BOOST_TEST. Example and further discussion are in https://github.com/open-source-parsers/jsoncpp/issues/671.
2017-09-14 09:31:36 +02:00
Christopher Dunn
f2f19b03fb Merge pull request #670 from cdunn2001/fix-travis
Fix travis
2017-09-13 23:07:21 -05:00
Christopher Dunn
026c39fa1a Try Travis support suggestion for py3
Hi Christopher,

Thank you for reaching out and sorry to hear about the troubles.

Regarding the pip3 error, it was indeed caused by our image updates. We've cleaned-up the way we set-up the Python environment and now strictly enforce Python version use using pyenv. Which means that if you want to use a different Python version than the system one (which is 2.7.6), you have to explicitly specify it. Adding a "before_install: pyenv global 3.5" step to your travis.yml should switch the system version and make pip3 work without installing any additional packages.
2017-09-13 22:36:39 -05:00
Christopher Dunn
614671d09b Merge pull request #669 from cdunn2001/avoid-redundant-depreciation-warnings
Ignoring the unrelated TravisCI build errors. Those are being addressed separately, in #670.
2017-09-11 14:00:59 -05:00
Christopher Dunn
132840aaa1 More VS warning prevention
See comment by jpo38 in SO:
* https://stackoverflow.com/questions/46151531/how-works-deprecated-warnings-and-how-to-remove-them-when-using-jsoncpp/46156833#46156833
2017-09-11 13:44:07 -05:00
Motti Lanzkron
9bb984a594 Update writer.h
fix typos
2017-09-11 13:17:21 -05:00