-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Return JSON as reference #1631
Comments
You probably need an // Get the internal private member reference:
json& j = app.get_file(); |
Thank you! I added the "&" and got it working now! My last ImGui problem is in this code:
I got no errors in compilation time, but when I ran it in Visual Studio 2019, it goes to Here is the exception message:
Here is the
How can I do the "push_back" operation to add the new JSON object into the JSON private member? Thanks! |
// Fill the new JSON object with dummy data:
n["new1"] = "new field";
n["new2"].push_back("item 1");
n["new2"].push_back("item 2");
... I'm not sure if it is necessary in this case, but it is always a good practice to be explicit in object construction. So, you might use // Fill the new JSON object with dummy data:
n["new1"] = "new field";
n["new2"] = json::array();
n["new2"].push_back("item 1");
n["new2"].push_back("item 2");
... // Insert the new JSON object into the private member JSON object:
// This private JSON alreay have the "pecas" array inside it.
j["pecas"].push_back(n); Does that mean Also, can you put |
Thank you Nickaein, and sorry about that... Following your directions I found that actually my error is in the GLFW loop when its try to load the "new fields" By the way, this JSON library is really amazing! Thank you! |
No problem! Yes, it is indeed an amazing library, thanks to all people who has contributed and users who reported their issues :-) If you don't need further assistant on this particular issue you can close it. You are welcome to open a separate issue for future questions/requests/bug reports. |
Hi, I would like to get a reference to a JSON object that is a private member of my Application Class
---- My class ------
------ My Main ----------
I got no errors in compile time, but the new modifications that I should do in the Main function do not be apply in the original private member (_file).
That is, the JSON private member remains unchanged.
How can I do it?
The text was updated successfully, but these errors were encountered: