diff options
author | 2021-03-03 22:45:23 +0000 | |
---|---|---|
committer | 2021-03-03 22:45:23 +0000 | |
commit | 14fff93b3fbab6d5ba94a27a692a06c414bbdde7 (patch) | |
tree | 3c9fbdab8e9e3c31f85d5d54ead10b72397c5066 | |
parent | 3cbc44875c3ca02b5ffd78a70b556fa0d34ce722 (diff) | |
parent | c8379556c00be65cd6f5c66c6b2083b94f6550bc (diff) |
Merge "[bit] Use new jsoncpp API" am: c8379556c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607474
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ided8274dc9cb5a63e7ab04f0612a3b04a2214c90
-rw-r--r-- | tools/bit/make.cpp | 17 |
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; } |