I am trying to deserialize json file with Cereal library , the problem is that ifstream
is not supported from what I have seen in an issue in github and also tried myself.
so this:
std::ifstream input("config.json");
cereal::JSONInputArchive archive(input);
won't work.
I have tried to read each line of the file into stringstream
, which also isn't working because from what I have seen cereal::JSONInputArchive
expect the format of the json to have quotation mark
with escape characters like this -
\"
and stringstream
isn't doing that while reading the file line by line.
I couldn't figure out a way to deserialize json with Cereal.