-
Notifications
You must be signed in to change notification settings - Fork 2.7k
why change the default output format #181
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
Comments
Please tell us which commit you are using, and if possible, which commit or version you were using. Also, which |
the version is 1.4.4 and my code like this: int main(int argc, const char *argv[])
{
Json::Value root;
std::string example = "{\"array\":[\"item1\", \"item2\", \"item2\", \"item2\"], \"foo\":\"asdf\"}";
Json::Reader reader;
bool parsed = reader.parse(example, root, false);
std::cout << root << std::endl;
return 0;
} +++++++++++++++++++++++ {
"array" :
[
"item1",
"item2",
"item2",
"item2"
],
"foo" : "asdf"
} |
What commit/version were you using before, when things worked correctly? |
I assume you were using the Instead of std::cout << root << std::endl; try Json::StreamWriterBuilder builder;
builder.settings_["commentStyle"] = "None"; // default is "All"
cout << Json::writeString(builder, root); The reason for the change is that
Sorry. I hope the work-around is ok. |
the header file shows work-around is ok , yes. I like it. thank you, thank you very much. |
Json::FastWriter can be used to get output in a std::string form. |
thank you. |
I wouldn't recommend I suggest |
I am using StreamWriterBuilder plus Json::writeString() , thank you. :) |
Hi ~
I found writer output is changed.
before array output like this.
["aaa","bbb","ccc","ddd"] in one line.
but now it like this.
[
"aaa",
"bbb",
"ccc",
"ddd"
]
why you change it ?.
I like one line format, It not take so much place. if array is too long you can new line by 30 item.
thank you.
The text was updated successfully, but these errors were encountered: