Commit Graph

102 Commits

Author SHA1 Message Date
Evan Driscoll
edb6b25569 Fancy printer predicate now takes current JSON object
The API is ugly at the moment. Will fix with an ugly
implementation soon.
2018-06-04 21:59:21 -05:00
Evan Driscoll
5f0870ef34 Expose the matcher predicate from fancy stylizer 2018-06-03 22:26:55 -05:00
Evan Driscoll
d0eb2f21d3 Refactor: fancy_serializer passes json_pointer to stylizer 2018-06-03 22:06:27 -05:00
Evan Driscoll
ca3f3959a8 Refactor: fancy_serializer tracks a json_pointer context 2018-06-03 22:02:07 -05:00
Evan Driscoll
91971e394f Provide accessors into json_pointer 2018-06-03 21:52:28 -05:00
Evan Driscoll
6c746460c6 Add missing header file 2018-06-03 21:51:45 -05:00
Evan Driscoll
860661987f Spaces after commas (in [1, 2]) is controllable separately from multiline 2018-06-03 00:02:49 -05:00
Evan Driscoll
e7b02c10dd Spaces after a colon (in {"k": v}) controllable separately from multiline 2018-06-03 00:00:12 -05:00
Evan Driscoll
ec756e47ad Refactor: don't indent when multiline is false 2018-06-02 23:52:30 -05:00
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
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
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
e9cb8f604d Split primitive serialization into own class 2018-06-02 00:16:08 -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
fe90fa5181 Run 'make almalgamate'
astyle reformatted some stuff... I... don't know why.
2018-06-01 23:11:34 -05: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
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
e94862a649
🚑 fixed error in callback logic 2018-05-06 19:00:49 +02:00
Niels Lohmann
5ff2abb90d
Merge branch 'develop' into feature/sax2 2018-05-06 13:29:23 +02:00
Niels Lohmann
ed69e50ad2
📄 added SPDX-License-Identifier 2018-05-03 17:41:45 +02:00
Niels Lohmann
fa3e42f826
Merge branch 'develop' into feature/wstring 2018-04-29 13:16:12 +02:00
Jan Schöppach
65b4d8251b
Fix typo in single_include, too 2018-04-17 13:02:36 +02:00
Niels Lohmann
cf91b4f2bb
Merge branch 'develop' into feature/wstring 2018-04-08 11:36:58 +02:00
Niels Lohmann
e1ea8369ad
Merge branch 'develop' into feature/sax2 2018-04-08 09:31:59 +02:00
Niels Lohmann
08a7233d1b
🚑 fixed commit 1e08654 2018-04-02 22:38:44 +02:00
Niels Lohmann
1e08654f99
🔨 cleanup 2018-04-02 22:25:17 +02:00
Niels Lohmann
aa89c5e048
🔨 removing unget_character() function from input adapters #834 2018-04-02 21:10:48 +02:00
Niels Lohmann
16c5bfeaad
👌 fixed compiler warnings #1031 2018-04-02 13:01:56 +02:00
Niels Lohmann
eb06d0531a
🚧 added input adapter for wide strings #1031 2018-04-01 19:12:36 +02:00
Niels Lohmann
ba6edd5634
🔨 cleanup 2018-03-30 00:38:18 +02:00
Niels Lohmann
850671b9f1
🔨 using a vector<bool> for the parser hierarchy 2018-03-29 18:45:43 +02:00
Niels Lohmann
5f723bbec6
🔨 realized callback parser wirh SAX interface #971 2018-03-28 23:39:39 +02:00