Replies: 2 comments 1 reply
-
Not, it is not possible in the moment to just add spaces after commas or colons. You can provide a parameter to std::cout << j1.dump(2) << std::endl; {
"Type": "COMMAND",
"ID": "SET_PARAMS",
"Payload": {
"MPR.save_dir": "",
"MPR.read_from_file": 0.0,
"Cfg.inCarGeneralData.EngineIsOn": 1,
"Cfg.inCarGeneralData.sbr": [
1,
1,
1,
1,
1,
1,
1
],
"Cfg.inCarGeneralData.doors": [
1,
1,
1,
1
]
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
Hi Niels. Thanks for your help again, I don´t need any further assistance,
you can close this issue now.
…On Thu, 2 Sept 2021 at 03:43, Niels Lohmann ***@***.***> wrote:
Do you need further assistance with this issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2942 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGYMHVCEQNNA5LOCDA26V2DT7Z675ANCNFSM5CLOTE3Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The idea comes from the fact that the python JSON library adds additional separated characters when dumping JSON objects to strings. For example.
The dumped string is as follows:
'{"Type": "COMMAND", "ID": "SET_PARAMS", "Payload": {"MPR.save_dir": "", "MPR.read_from_file": 0.0, "Cfg.inCarGeneralData.EngineIsOn": 1, "Cfg.inCarGeneralData.sbr": [1, 1, 1, 1, 1, 1, 1], "Cfg.inCarGeneralData.doors": [1, 1, 1, 1]}}'
However, with this library, the following C++ code snippet
generates unseparated string as follows:
The question is : can we achieve the same result(separated string) as in the python JSON library case? in the library or application level?
Beta Was this translation helpful? Give feedback.
All reactions