summaryrefslogtreecommitdiff
path: root/tools/bit/make.cpp
diff options
context:
space:
mode:
author Haibo Huang <hhb@google.com> 2021-03-04 00:17:27 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2021-03-04 00:17:27 +0000
commitf154eead04fef66c46f25c4ec3e26533a0a5bb43 (patch)
tree0223a19ae60176aae3a1728b2deb04325758343b /tools/bit/make.cpp
parent83c6b7ff16713ec90a0f9aa71ea9ae6275419470 (diff)
parent45b069f0156c47375a7efd92253f553f085ab3f0 (diff)
Merge "[bit] Use new jsoncpp API" am: c8379556c0 am: 14fff93b3f am: 45b069f015
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607474 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I3ff7e266c20f35a37bda1469dded280d443d3518
Diffstat (limited to 'tools/bit/make.cpp')
-rw-r--r--tools/bit/make.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/bit/make.cpp b/tools/bit/make.cpp
index df64a801e213..c39f49465054 100644
--- a/tools/bit/make.cpp
+++ b/tools/bit/make.cpp
@@ -89,8 +89,9 @@ BuildVars::BuildVars(const string& outDir, const string& buildProduct,
}
Json::Value json;
- Json::Reader reader;
- if (!reader.parse(stream, json)) {
+ Json::CharReaderBuilder builder;
+ std::string errorMessage;
+ if (!Json::parseFromStream(builder, stream, &json, &errorMessage)) {
return;
}
@@ -132,8 +133,9 @@ BuildVars::save()
return;
}
- Json::StyledStreamWriter writer(" ");
-
+ Json::StreamWriterBuilder factory;
+ factory["indentation"] = " ";
+ std::unique_ptr<Json::StreamWriter> const writer(factory.newStreamWriter());
Json::Value json(Json::objectValue);
for (map<string,string>::const_iterator it = m_cache.begin(); it != m_cache.end(); it++) {
@@ -141,7 +143,7 @@ BuildVars::save()
}
std::ofstream stream(m_filename, std::ofstream::binary);
- writer.write(stream, json);
+ writer->write(json, &stream);
}
string
@@ -212,8 +214,9 @@ read_modules(const string& buildOut, const string& device, map<string,Module>* r
}
Json::Value json;
- Json::Reader reader;
- if (!reader.parse(stream, json)) {
+ Json::CharReaderBuilder builder;
+ std::string errorMessage;
+ if (!Json::parseFromStream(builder, stream, &json, &errorMessage)) {
json_error(filename, "can't parse json format", quiet);
return;
}