You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to read a value in a json file but I cannot be sure that the variable exists in the file.
When I try to get the value of a non existing key it comes with an error and the program shuts down.
I wonder if there if any way to check if a variable with this key exists in the file before reading it. So this way I could avoid he error.
Thank you for your response.
Now there is another Issue since I changed to the last version of the single include file.
When I try to compile, there are some error messages like this:
error: redefinition of ‘class nlohmann::json_pointer’
class json_pointer
Before I was using version 3.1.2. I updated it because this previous version does not include the 'contains' method.
Activity
t-b commentedon Mar 11, 2020
@AlejandroCastillejo The
containsmethod should do the trick, see https://nlohmann.github.io/json/classnlohmann_1_1basic__json_a9286acdc0578fc66e9346323e69fc0e3.html#a9286acdc0578fc66e9346323e69fc0e3.AlejandroCastillejo commentedon Mar 12, 2020
Thank you for your response.
Now there is another Issue since I changed to the last version of the single include file.
When I try to compile, there are some error messages like this:
error: redefinition of ‘class nlohmann::json_pointer’
class json_pointer
Before I was using version 3.1.2. I updated it because this previous version does not include the 'contains' method.
Thanks again for your help.
nlohmann commentedon Mar 13, 2020
In order to asses your issue, we need the following information:
What is the issue you have?
Please describe the steps to reproduce the issue. Can you provide a small but working code example?
What is the expected behavior?
And what is the actual behavior instead?
Which compiler and operating system are you using? Is it a supported compiler?
Did you use a released version of the library or the version from the
developbranch?If you experience a compilation error: can you compile and run the unit tests?