Commit graph

114 commits

Author SHA1 Message Date
Niels Lohmann
9e3c4ad11f
🔖 set version to 3.0.0 2017-12-17 08:31:18 +01:00
Niels Lohmann
8419bfbbd2
improved test coverage
As we guarantee proper UTF-8 before, we do not need to cope with it later.
2017-12-12 20:44:57 +01:00
Niels Lohmann
569d275f65
💥 throwing an exception in case dump encounters a non-UTF-8 string #838
We had a lot of issues with failing roundtrips (i.e., parse errors from serializations) in case string were stored in the library that were not UTF-8 encoded. This PR adds an exception in this case.
2017-12-11 22:38:05 +01:00
Niels Lohmann
430f03512c
🚨 fixed some warnings #821 2017-11-25 22:06:18 +01:00
Niels Lohmann
de75cf89f7
improved test coverage 2017-11-25 19:41:02 +01:00
Niels Lohmann
5696660eba
🔨 another try to fix #714
adding std::ios_base::binary when opening all_unicode.json.cbor
2017-10-31 15:04:14 +01:00
Théo DELRIEU
4b46abf97c
add forwarding references to json_ref constructor
fixes #805
2017-10-28 14:22:57 +02:00
Niels Lohmann
734e2b73cf
🔨 cleanup 2017-10-27 11:49:24 +02:00
Niels Lohmann
1b1bd0e3e6
#714 is still not fixed 2017-10-23 12:01:50 +02:00
Niels Lohmann
89650c99dd
🚧 checking if #714 is now fixed with MSVC
Hopefully, #764 fixed this.
2017-10-22 11:16:33 +02:00
Niels Lohmann
b0c380b0f8
📝 cleanup after the last PRs 2017-10-22 09:12:35 +02:00
Perry Kundert
f585fe4eec Test to confirm parsing of multiple JSON records in a istream #367 2017-10-05 16:01:41 -07:00
Niels Lohmann
91e0032853
📝 improved documentation 2017-08-29 23:46:26 +02:00
Niels Lohmann
9fd031b6f4
🐛 re-added support for std::valarray #702 2017-08-22 23:28:23 +02:00
Niels Lohmann
22b59693f1
💥 CBOR/MessagePack input must end with EOF #505
The CBOR and MessagePack parsers now expect the input to be read until the end. Unless the new parameter "strict" is set to false (it is true by default), an exception is raised if the parser ends prematurely. This is a breaking change as the parsers ignored unread input so far.

Furthermore, the offset/startIndex paramter introduced in #462 was removed as this behavior can be mimicked with an iterator range. For instance, instead of calling "from_cbor(vec, 5);", you can write "from_cbor({vec.begin()+5, vec.end()});".
2017-08-16 14:48:23 +02:00
Niels Lohmann
87bccbc335
🔨 removed exception parse_error.111
It makes no sense to have this special exception. Instead of throwing when an input adapter is created, it is better to detect a parse error in later usage when an EOF is "read" unexpectedly.
2017-07-08 21:35:13 +02:00
Niels Lohmann
8b123107c0
🔨 fixed some pedantic GCC warnings 2017-07-07 22:41:22 +02:00
Niels Lohmann
6f3bebff5c
🔨 removed unexpect function 2017-06-21 07:26:50 +02:00
Niels Lohmann
1fbb82de89
🔨 using std::array to buffer input 2017-06-17 20:47:53 +02:00
Niels Lohmann
889006f006
regression test for #600 2017-06-17 13:37:04 +02:00
Niels Lohmann
afb959a083
🔨 removed nonportable code 2017-06-12 19:02:08 +02:00
Niels Lohmann
ac793e957f
🔨 trying to fix #367
Code from https://stackoverflow.com/a/44503794/266378 which is hopefully working with MSVC.
2017-06-12 18:58:58 +02:00
Niels Lohmann
d19c5ced4b
🐛 skipping BOM for iterators #602
I totally forgot about byte order marks in this scenario.
2017-06-02 12:38:32 +02:00
Niels Lohmann
c043ba6978
🔥 removed failing test #529 2017-06-01 07:32:39 +02:00
Niels Lohmann
52adf3fd5b
🔨 fixed compilation 2017-05-22 22:59:57 +02:00
Niels Lohmann
9a576fe1d9
added test for #367 2017-05-22 22:49:39 +02:00
Niels Lohmann
9e507dfad5
tests and fix for #367
operator>> now works as expected.
2017-05-21 16:36:51 +02:00
Niels Lohmann
fba1bcdd0b
🐛 fixing #575
I forgot to consider the offset.
2017-05-07 13:41:48 +02:00
Niels Lohmann
d62d48fc48
🔀 merge branch 'develop' into feature/manual_lexer 2017-04-07 17:19:52 +02:00
Niels Lohmann
90273e930c
🐛 fix for #512
We totally forgot to implement the comparison operators other than ==
and != for scalar types. Consequently, comparing a JSON value with a
scalar type led to compile errors.
2017-04-07 15:44:41 +02:00
Niels Lohmann
b15fc13dd1
🔨 implemented MessagePack in binary_reader 2017-04-04 16:59:19 +02:00
Niels Lohmann
89efe627fe
🔨 a lot of restructuring
- removed uncached input stream adapter; it was too slow anyway
- implemented a class binary_read which parses CBOR based on input
adapters
- in the CBOR parser, numbers are created via memcpy to avoid undefined
behavior
2017-04-02 18:46:21 +02:00
Niels Lohmann
60057a4728
🔨 fixed bugs introduced by merging from develop 2017-03-29 07:54:26 +02:00
Niels Lohmann
a690a9f2d2
Merge branch 'develop' into feature/manual_lexer 2017-03-29 00:57:09 +02:00
Niels Lohmann
c2e80a72d7
🔨 deprecated j << istream / j >> ostream functions #367
The implementation is non-standard. Deprecation allows a simpler API in
the future without removing any features.
2017-03-29 00:39:47 +02:00
Niels Lohmann
9578c0f700
Merge branch 'develop' into feature/manual_lexer 2017-03-28 23:47:17 +02:00
Niels Lohmann
b4dbebffcd
added regression test for #464 2017-03-28 23:28:54 +02:00
Niels Lohmann
06e2a291b1
🔨 fixed number parsing 2017-03-26 17:26:41 +02:00
Niels Lohmann
40160f482a
🚧 manual lexer
This commit removed the re2c lexer and replaced it by a manual version.
Its integration is not yet complete: number parsing does not respect
locales or overflows. Furthermore, parsing does not need to end with
EOF. Therefore, a lot of test cases fail. The idea is to push this
branch forward so we can conduct performance comparisons. So far, a
nice side effect are better diagnosis messages in case of parse errors.
2017-03-24 19:49:02 +01:00
Niels Lohmann
c5711f3072
🚧 a lot of minor changes
- Removed unused headers.
- Added override where needed.
- Added description for parse_error.113 exception.
- Fixed some conversion warnings.
- Integrated cbor_expect_string function for CBOR maps.
- Added documentation on the supported CBOR/MessagePack features.
- Added test to check all initial bytes for CBOR input.
2017-03-16 18:39:33 +01:00
Niels Lohmann
1de80e8af4
🔨 added user-defined exception #493
Replaced old std::invalid_argument exception by parse_error.111 to have
unified exceptions in case of input stream errors.
2017-03-14 21:31:36 +01:00
Niels Lohmann
63c2c62f19
🔨 changed call from "not good()" to "fail()" #493
Also merged develop into this feature branch.
2017-03-14 21:24:53 +01:00
Niels Lohmann
b026591e9e
🚑 added special case to fuzzers to fix #504
Since #329, NaN and inf numbers do not yield an exception, but are
stored internally and are dumped as “null”. This commit adjusts the
fuzz testers to deal with this special case.
2017-03-14 21:05:38 +01:00
Niels Lohmann
bfe4788e32
🚑 fix for #500
Removed a check that already failed in MSVC.
2017-03-14 16:14:05 +01:00
Niels Lohmann
84072fbd6d
💄 fixed indentation 2017-03-14 16:07:28 +01:00
Niels Lohmann
c5cf32e34d
🔨 added user-defined exception 406 2017-03-12 20:59:33 +01:00
Niels Lohmann
855cdcf05c
🔀 merge branch 'develop' into feature/exceptions_3.0.0 2017-03-12 20:22:30 +01:00
Niels Lohmann
8feaf8dc94
💥 implemented new handling of NaN and INF #70 #329 #388
- If an overflow occurs during parsing a number from a JSON text, an
exception (std::out_of_range for the moment, to be replaced by a
user-defined exception #244) is thrown so that the overflow is detected
early and roundtripping is guaranteed.
- NaN and INF floating-point values can be stored in a JSON value and
are not replaced by null. That is, the basic_json class behaves like
double in this regard (no exception occurs). However, NaN and INF are
serialized to “null”.
- Adjusted test cases appropriately.
2017-03-12 18:38:05 +01:00
Niels Lohmann
87eafd8d6a
added regression tests for #473
These tests currently pass without any adjustments to the source code.
2017-03-12 15:20:17 +01:00
Niels Lohmann
89f6068385
Merge branch 'develop' into feature/exceptions_3.0.0 2017-03-12 11:51:24 +01:00