Commit Graph

1050 Commits

Author SHA1 Message Date
Billy Donahue
0ba5c435f4 Improvements in writing precision and json_tool.h helpers 2018-05-11 14:31:12 -04:00
fo40225
cf73619e28 refactoring cross compiler macro 2018-05-09 02:06:19 -05:00
Christopher Dunn
ded953e0a6
Merge pull request #771 from Binyang2014/master
Disable warning "C4702" when compiling json cpp using vs2013 and above

resolves #759
2018-05-09 02:04:08 -05:00
binyangl
0a62267fe4 Disable warning "C4702" when compiling json cpp using vs2013 and above 2018-05-08 20:55:30 +08:00
Christopher Dunn
2cc9b24f0d
Merge pull request #768 from fo40225/fix_msvc_fpfast
Fix msvc /fp:fast test failure
2018-05-08 00:30:14 -05:00
fo40225
6e5e9be736 corss compiler isnan 2018-05-08 12:35:08 +08:00
fo40225
4050143288 fix ValueTest/integers, CharReaderAllowSpecialFloatsTest/issue209 test failure when fp:fast on msvc 2018-05-05 15:05:22 +08:00
fo40225
3f0d91f08a fix ValueTest/specialFloats test failure when fp:fast on msvc 2018-05-05 14:38:53 +08:00
Christopher Dunn
02211117f1
Merge pull request #764 from Melown/master
allow out-of-source build
2018-04-20 00:22:22 -05:00
Tomáš Malý
323450eafc allow out-of-source build 2018-04-17 16:16:54 +02:00
Christopher Dunn
af17fecd29
Merge pull request #760 from ldionne/master
[CMake] Generate CMake config files by default
2018-04-05 19:36:03 -05:00
Louis Dionne
ffc62d26f3 [CMake] Generate CMake config files by default 2018-04-05 16:37:58 -07:00
Mike R
a07fc53287 Add setting precision for json writers and also add decimal places precision type. (#752)
* Added setting precision for writers.
* Added special case for precise precision and global precision.
* Added good setting of type of precision and also added this type to BuiltStreamWriter and for its settings.
* Added some tests.
2018-03-13 15:35:31 -05:00
Christopher Dunn
af2598cdd3
Merge pull request #751 from open-source-parsers/properly_swappable
Remove std::swap<Json::Value> in favor of ADL
2018-03-06 17:14:24 -06:00
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 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