So this is my JSON:
string js = R"({"table":"orderBookL2_25","action":"insert","data":[{"symbol":"XBTUSD","id":8796514950,"side":"Buy","size":10000,"price":34850.5},{"symbol":"XBTUSD","id":8796515700,"side":"Buy","size":281,"price":34843}]})";
I want to somehow convert it into object that could help me to conveniently access values. For example, something like that;
parsed_data["data"][0]["symbol"]
I have tried to use JSON::Boost but I don't know how to parse using this library. I have tried this code:
json::value parsed_data{js}; cout << parsed_data.at(0);
But the output from it is worthless:
"{\"table\":\"orderBookL2_25\",\"action\":\"insert\",\"data\":[{\"symbol\":\"XBTUSD\",\"id\":8796514950,\"side\":\"Buy\",\"size\":10000,\"price\":34850.5},{\"symbol\":\"XBTUSD\",\"id\":8796515700,\"side\":\"Buy\",\"size\":281,\"price\":34843}]}"