Skip to content

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

@benjaminaudet

Description

@benjaminaudet

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions