Replies: 2 comments
-
or you can just use my fork: https://github.com/Acwme/jsoncpp |
Beta Was this translation helpful? Give feedback.
0 replies
-
Our doxygen docs have some formatting problems right now, but that's trying to explain what's possible today: If you configure JSON with I don't understand what the output would be that you want. Try posting with "markdown". |
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
-
In my project, the json file is like:
{
"a" : {
"a1" : "b1",
"a2" : [
14200,
14200,
14200,
14200
]
}
}
But when I use StreamWriter to write json file, it becomes:
{
"a" :
{
"a1" : "b1",
"a2" :
[
14200,
14200,
14200,
14200
]
}
}
I can't find a way to keep the first format of writing in the attribute of StreamWriter, so I modify the source file json_writer.cpp to solve it.
void BuiltStyledStreamWriter::writeWithIndent(String const& value) {
//to avoid "{" and "[" begin a new line.
if (value == "{" || value == "[") //added
indented_ = true; //added
if (!indented_)
writeIndent();
*sout_ << value;
indented_ = false;
}
Hope to help someone like me.
Beta Was this translation helpful? Give feedback.
All reactions