Suggested methods for Serialize/deserialize Json to plain old C++ objects
===

Right now I'm coming from a C# background, and projects such as json.net.

Serialization is as easy as...

    Product product = new Product();
    product.Name = "Apple";
    product.Expiry = new DateTime(2008, 12, 28);
    product.Price = 3.99M;
    product.Sizes = new string[] { "Small", "Medium", "Large" };
     
    string json = JsonConvert.SerializeObject(product);
    //{
    //  "Name": "Apple",
    //  "Expiry": new Date(1230422400000),
    //  "Price": 3.99,
    //  "Sizes": [
    //    "Small",
    //    "Medium",
    //    "Large"
    //  ]
    //}
     

And deserialization is as easy as...

    Product deserializedProduct = JsonConvert.DeserializeObject<Product>(json);

Right now I'm moving to C++, investigating projects, but nothing seems to really do this.  I've seen projects that dump objects to json using boost. Found nice ways of iterating over json, but nothing that really helps with serializing and deserializing Json to and from plain old C++ objects.

Am I missing something, are there open source projects that do this, or is this a situation where everyone builds it by hand?  It almost seems easier to convert the end points to use protocol buffer and use it.

Any suggestions would be greatly appreciated.



