Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f48d2936 authored by Haibo Huang's avatar Haibo Huang Committed by Automerger Merge Worker
Browse files

Merge "[bit] Use new jsoncpp API" am: c8379556 am: 14fff93b am: 45b069f0 am: f154eead

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607474

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie4cd95928538a2862fa43aac6febe4b417734290
parents 37a27a40 f154eead
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -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;
    }