Evan Driscoll
af8dd92a0c
Refactor: introduce explicit multiline control
...
Instead of depending on indent_step
2018-06-02 23:48:26 -05:00
Evan Driscoll
5e10e97296
Refactor: dump_object_key_value
...
This isn't as clean as I wanted -- there's a lot more context
than I realized -- but I think it's still an improvement and
will become even moreso later
2018-06-02 23:35:38 -05:00
Evan Driscoll
ef679f8988
Fancy serializer: styles continue to propagate if not overridden
...
This is half a bug fix half just continuing work from befor
2018-06-02 23:17:42 -05:00
Evan Driscoll
186c7df25a
Can style subobjects of a object differently, by key
2018-06-02 23:10:28 -05:00
Evan Driscoll
7fa4431474
Refactor and prep: introduce new fancy_serializer_stylizer class
...
This will be able to provide multiple styles depending on context
2018-06-02 22:47:05 -05:00
Evan Driscoll
28e7eecf33
Fancy serializer can limit recursion depth
...
Elides objects with ... if that limit is exceeded
2018-06-02 22:22:24 -05:00
Evan Driscoll
cd0c225a50
Use raw literals for multi-line expected results
...
Prettyfies the test cases a bit, though there is a utiliity function
needed now.
2018-06-02 22:10:16 -05:00
Evan Driscoll
1c1c789084
Serializer edge case bug fix: very deep indents ignored indent_char
2018-06-02 21:34:55 -05:00
Evan Driscoll
a983e47619
Refactor: dump_object no longer splits cases by indent
2018-06-02 21:08:53 -05:00
Evan Driscoll
9cdf54b886
Refactor: dump_array doesn't split cases for indent
2018-06-02 21:01:22 -05:00
Evan Driscoll
cc4206a718
West const to match existing code
2018-06-02 20:52:12 -05:00
Evan Driscoll
dafee1343c
Refactor: dump tracks recursive depth, not indent size
...
This makes the depth independent of the indent_step and independent
of whether it's indenting at all
2018-06-02 20:51:26 -05:00
Evan Driscoll
f180227b6d
Fancy serializer: Split object and array handling into functions
2018-06-02 20:30:12 -05:00
Evan Driscoll
0500d41fbb
TODO note
2018-06-02 20:18:55 -05:00
Evan Driscoll
7dbfe2459b
Refactor: move string handling to dump_string
2018-06-02 20:15:07 -05:00
Evan Driscoll
d54f4653ed
It's now possible to limit the size of strings
2018-06-02 02:09:04 -05:00
Evan Driscoll
003f3e298b
Introduce fancy_serializer_style
2018-06-02 01:18:55 -05:00
Evan Driscoll
e38b4e8031
Re-support indentation in fancy_serializer
2018-06-02 01:07:25 -05:00
Evan Driscoll
297ff8e53f
Use primitive_serializer in fancy_serializer
2018-06-02 00:23:00 -05:00
Evan Driscoll
e9cb8f604d
Split primitive serialization into own class
2018-06-02 00:16:08 -05:00
Evan Driscoll
a2231324e9
Start reworking fancy serialization tests
2018-06-01 23:41:15 -05:00
Evan Driscoll
607b973035
Fancy Serialization: copy serializer to fancy_serializer
...
1. Copy header and rename; add to Makefile; amalgamate
2. Add as friend to basic_json
3. Copy operator<< to 'fancy_dump' and simplify
4. Change test to refer to that
2018-06-01 23:13:49 -05:00
Evan Driscoll
b584000e7c
Fancy serialiaztion: copy old serialization test file
...
Just copy unit-serialization to unit-fancy-serialization
2018-06-01 23:12:04 -05:00
Evan Driscoll
fe90fa5181
Run 'make almalgamate'
...
astyle reformatted some stuff... I... don't know why.
2018-06-01 23:11:34 -05:00
Niels Lohmann
e830bc502f
Merge pull request #1117 from TinyTinni/develop
...
remove stringstream dependency
2018-06-01 08:05:45 +02:00
Matthias Möller
ecadcdb593
added char cast
...
should fix the GCC unittest
2018-05-31 16:36:16 +02:00
Matthias Möller
48656a49f5
typo
2018-05-31 15:32:21 +02:00
Matthias Möller
64acb42aa7
remove stringstream dependency
2018-05-31 13:45:58 +02:00
Niels Lohmann
8efbf8d7bb
📝 documentation to avoid future issues like #1108
2018-05-28 18:14:44 +02:00
Niels Lohmann
e5a67fc3f8
Merge branch 'develop' of https://github.com/nlohmann/json into develop
2018-05-28 17:57:46 +02:00
Niels Lohmann
a49644ab74
🚑 adjusted Fuzzer to new parser
...
out_of_range exceptions where unexpected before - the parser used to crash in these situations...
2018-05-28 17:57:22 +02:00
Niels Lohmann
0efaf891e5
Merge pull request #1089 from theodelrieu/feature/map_conversion
...
Provide a from_json overload for std::map
2018-05-28 14:53:23 +02:00
Théo DELRIEU
c5e63fd684
Provide a from_json overload for std::map
...
This overload is chosen only when BasicJsonType::string_t
is not constructible from std::map::key_type.
Currently, converting a map to json treats it as an array of pairs.
fixes #1079
2018-05-28 11:06:24 +02:00
Niels Lohmann
db03d09312
Merge branch 'feature/key_ref' into develop ( fixes #1098 )
2018-05-27 22:26:00 +02:00
Niels Lohmann
cf9299d222
Merge branch 'feature/sax2' into develop #971
2018-05-27 18:12:59 +02:00
Niels Lohmann
3cdc4d784b
📝 added documentation
2018-05-27 18:07:53 +02:00
Niels Lohmann
adf09726b0
Merge branch 'develop' into feature/sax2
2018-05-27 14:26:13 +02:00
Niels Lohmann
481ace65c4
🔨 only calculate array index string when needed #1098
2018-05-27 12:04:22 +02:00
Niels Lohmann
1c6b332dcd
👌 mitigating cppcheck bug #1101
2018-05-26 14:10:13 +02:00
Niels Lohmann
90eb0a91e0
⚡ keys are now returned as const reference #1098
2018-05-26 13:26:40 +02:00
Niels Lohmann
1f84cc2c88
✅ adjusted test cases
2018-05-17 16:50:37 +02:00
Niels Lohmann
717301d1bc
Merge branch 'testsuite' into feature/sax2
2018-05-17 16:36:43 +02:00
Niels Lohmann
4639bb2c8f
✅ added more tests from recent nst's JSONTestSuite
2018-05-17 10:10:01 +02:00
Niels Lohmann
e94862a649
🚑 fixed error in callback logic
2018-05-06 19:00:49 +02:00
Niels Lohmann
ae213721b1
🔨 removed unget function for wstring parsers
2018-05-06 14:05:29 +02:00
Niels Lohmann
5ff2abb90d
Merge branch 'develop' into feature/sax2
2018-05-06 13:29:23 +02:00
Niels Lohmann
567fe9b7a0
Merge pull request #1078 from martin-mfg/patch-1
...
fix typo in README
2018-05-04 17:04:35 +02:00
martin-mfg
377e956655
fix typo in readme
...
The README says:
> "The library itself contains of a single header file ..."
I guess "consists of a" is the wording that was intended here. Alternatively, "contains a" might also be what was intended. Either way, I think both versions work equally well and thus choose the one that I believe was intended.
2018-05-03 22:42:52 +02:00
Niels Lohmann
5da596385b
Update issue templates
2018-05-03 18:35:56 +02:00
Niels Lohmann
7bbe7bb98f
🔥 removed old issue template
2018-05-03 18:35:21 +02:00