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

Reload a json file at runtime without emptying my std::ifstream #959

Closed
benjaminaudet opened this issue Feb 5, 2018 · 1 comment
Closed

Comments

@benjaminaudet
Copy link

benjaminaudet commented Feb 5, 2018

Hi !

Feature Request

  • Describe the feature in as much detail as possible.

I have to reload a JSON file at runtime. I actually use std::ifstream to open my json file and I fill the json object with the >> operator. I don't want to re-open my file with my ifstream but just set the stream position to 0 using std::ifstream::seekg.
The problem is : When I pass it to json object, my ifstream is empty. Is there a way to build a json object via an ifstream without emptying it ?

Thanks in advance.

@benjaminaudet
Copy link
Author

Find a way to do it via stringstream.

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