-
-
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
Is there a way of format just making a pretty print without changing the key's orders ? #713
Labels
Comments
maybe this function can help a little std::string json_string = "{\"root\":{\"result\":0,\"description\":\"flush success\"},\"config\":{\"result\":0,\"description\":\"flush success\"},\"query\":{\"result\":0,\"description\":\"flush success\"},\"dump\":{\"result\":0,\"description\":\"flush success\"}}";
std::string pretty_json;
std::string::size_type pos = 0;
size_t le = 0;
prettyJson(pretty_json, json_string, pos, le); result: {
"root": {
"result": 0,
"description": "flush success"
},
"config": {
"result": 0,
"description": "flush success"
},
"query": {
"result": 0,
"description": "flush success"
},
"dump": {
"result": 0,
"description": "flush success"
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for example, format like this, just adjust the indent, not change key's orders
The text was updated successfully, but these errors were encountered: