Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deserialize json with cereal #770

Open
yuvalco opened this issue Nov 14, 2022 · 0 comments
Open

deserialize json with cereal #770

yuvalco opened this issue Nov 14, 2022 · 0 comments

Comments

@yuvalco
Copy link

yuvalco commented Nov 14, 2022

I am trying to deserialize json file, the problem is that ifstream is not supported from what I have seen in another issue and 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 reading the file line by line.

I have searched the net and Cereal docs but couldn't find a way to deserialize json.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant