I am searching for a minimal full executable qt or c++ code example to parse and write this Json code:
{ "FirstName": "John", "LastName": "Doe", "MiddleName": null, "Age": 43, "Address": { "Street": "Downing Street 10", "City": "London", "Country": "Great Britain" }, "Phone numbers": [ "+44 1234567", "+44 2345678" ] "Valid":true, } - The above example consists of an object with 5 key/value pairs. Two of the values are strings, one is a number,
- one is another object and the last one an array.
- A valid JSON document is either an array or an object, so a document always starts with a square or curly bracket.
EDIT:
- Json has 2 more key/value pairs - value 'null' and 'bool'
And yes, I have seen a "Save Game Example" and tried to figure it out.
But after nearly a week I gave up to transfer a minimal Example without enums, QVectors and 3 different header Files over to my project to handle the code snippet. Doesn't matter if its for a widget or core code.
I already did a xml read and write program successfully but it seems I miss some Important point and get errors with json that may or may not have to do with the parsing. I am not able to rule it out without a minimal fully working code example.
So my question is: Could you please provide a minimal Example to write, read and print the Json file? Thanks upfront.
