mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-01-14 09:57:56 +08:00
switch from StyledWriter to StyledStream writer in tests
This commit is contained in:
parent
ee8b58f82f
commit
2160c9a042
@ -8,6 +8,7 @@
|
||||
|
||||
#include <json/json.h>
|
||||
#include <algorithm> // sort
|
||||
#include <sstream>
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
@ -158,8 +159,10 @@ static int rewriteValueTree(const std::string& rewritePath,
|
||||
std::string& rewrite) {
|
||||
// Json::FastWriter writer;
|
||||
// writer.enableYAMLCompatibility();
|
||||
Json::StyledWriter writer;
|
||||
rewrite = writer.write(root);
|
||||
Json::StyledStreamWriter writer;
|
||||
std::ostringstream sout;
|
||||
writer.write(sout, root);
|
||||
rewrite = sout.str();
|
||||
FILE* fout = fopen(rewritePath.c_str(), "wt");
|
||||
if (!fout) {
|
||||
printf("Failed to create rewrite file: %s\n", rewritePath.c_str());
|
||||
|
Loading…
x
Reference in New Issue
Block a user