-
-
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
[Question] Unescaped dump #1479
Comments
If I understand correctly, you want the JSON string representation of each value. You could just call |
Yes that's what I'm doing, but Let me try to explain what I mean. Lets say I have the following :
I can do the parsing myself, I just want to make sure the capability to do this isn't already available so I don't take the perf hit of cleaning all the strings. |
Let's be more concrete and include something where the difference matters. Suppose you have the JSON string
Are you saying you want |
No, I would want the string "as-if deserialized and reserialized". So So the setup : |
Just a note though, I would be ok with |
I remember another issue like this where the recommendation was to walk through the elements in the array/object, and if the type is |
I think this is the one: #1181 |
If you need this for basic types too, then how are you going to distinguish the difference between the number 42 and the string "42"? For example, given the JSON object But, yes, you would need to do this at a higher level by switching on the type; there is nothing in the library that does this (because it removes information that cannot be recovered). |
Of course! That's perfect thx :) To answer your question, the output is html. So |
I'm using jsonformoderncpp as a simple intermediary to traverse json and store it in another hierarchical format. All I need is strings for every key/value pair, regardless of their type. I use
dump
, which works as expected, but it adds escaped quotes to values.Is their a way to get values "as is" without escaped quotes?
get<std::string>
can't work as it checks the json type is actually a string.The text was updated successfully, but these errors were encountered: