I have assigned string, integer and enum value to json object.
I need to get back the original value from jso object.
I am getting problem when converting json value to enum type.
enum Topic{ BOOK, PEN, PENCIL};
Json::Value record;
record["hello"] = "world";
record["number"] = 2;
record["topic"] = Topic;
std::string str = record["hello"].asString();
int val = record["number"].asInt();
enum TopicType = record["topic"];
What I have tried:
enum Topic{ BOOK, PEN, PENCIL};
Json::Value record;
record["hello"] = "world";
record["number"] = 2;
record["topic"] = Topic; // no error
std::string str = record["hello"].asString();
int val = record["number"].asInt();
enum TopicType = record["topic"]; // Error