On Mon, 13 Apr 2015 19:43:02 GMT, Sönke Ludwig wrote:
class Handshake { int some; string other; }
This is done with
deserializeJson
:json["data"].deserializeJson!Handshake
You can process nested structures, arrays, AAs etc. with it. If performance is a concern, this also allows to process the JSON sting directly, without parsing it into aJson
value first, so this is the generally recommended way to work with specific JSON structures.
nice, i somehow missed that.
can/will it ignore additional properties within the doc that are not defined in the class?
whats actually the current status of https://github.com/s-ludwig/stddatajson/tree/master/source/stdx/data/json versus vibe.d's parser?
i used the stddatajson for reading specific fields from a stream of docs where i needed only the header and it was way faster than anything else in d (but still half the speed i got with crystal).
i hope stddatajson makes into std, the lexer/parser are very nice to read!