Convert Json Object to Class Object

Hi @stevetranby
I am stuck on a problem ,
I have a json file with class object values
{
“employee1” : {
“name” : abc,
“age”:20,
“address”:“xyz”
}
}

and my class structure is
class Employee {
std::string name,
int age;
std::string address;
}

I am parsing json value with rapid json . Now i want to assign json Object value to my class Object value.
In java i used gson for this . How to achieve this in cocos2dx
Please help

1 Like