RFC: std.json sucessor

Ary Borenszweig via Digitalmars-d digitalmars-d at puremagic.com
Thu Aug 21 17:42:21 PDT 2014


On 8/21/14, 7:35 PM, Sönke Ludwig wrote:
> Following up on the recent "std.jgrandson" thread [1], I've picked up
> the work (a lot earlier than anticipated) and finished a first version
> of a loose blend of said std.jgrandson, vibe.data.json and some changes
> that I had planned for vibe.data.json for a while. I'm quite pleased by
> the results so far, although without a serialization framework it still
> misses a very important building block.
>
> Code: https://github.com/s-ludwig/std_data_json
> Docs: http://s-ludwig.github.io/std_data_json/
> DUB: http://code.dlang.org/packages/std_data_json

Say I have a class Person with name (string) and age (int) with a 
constructor that receives both. How would I create an instance of a 
Person from a json with the json stream?

Suppose the json is this:

{"age": 10, "name": "John"}

And the class is this:

class Person {
   this(string name, int age) {
     // ...
   }
}



More information about the Digitalmars-d mailing list