-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Serialize big data in json #1828
Comments
nop, json currently load ALL json into memory. It's a big feature to store part of json in memory depending on file pointers :) |
You can use the SAX interface to avoid parsing everything to memory. See https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a8a3dd150c2d1f0df3502d937de0871db.html#a8a3dd150c2d1f0df3502d937de0871db for more information. |
But can you use SAX to write not parse json to file? |
@nlohmann can i use it with memory mapped file (if i have just pointer to data and its size) ? |
No this is not possible in the moment. |
Yes, you can do this with json j = json::parse({data, size}); |
Do you need further assistance with this issue? |
For example, I want to add logged events to a JSON file and close it when I exit the program. I would also like to add them to a file as they become available.
What should I do to I make this work?
The text was updated successfully, but these errors were encountered: