From 458b877488c12ea4336d8fc00a95d9c0298bd6d0 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Mon, 25 Apr 2016 14:20:21 -0700 Subject: AAPT2: Add diff command Adds the diff command and various small fixes to issues discovered when diffing old AAPT built APKs with new AAPT2 built APKS. Bug:22775504 Change-Id: I682a7fe1cf4b3efa7cbd5d18b333cf2d1046fe1b --- tools/aapt2/ResourceTable.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tools/aapt2/ResourceTable.cpp') diff --git a/tools/aapt2/ResourceTable.cpp b/tools/aapt2/ResourceTable.cpp index 8d734f3fc36d..e700ed98365a 100644 --- a/tools/aapt2/ResourceTable.cpp +++ b/tools/aapt2/ResourceTable.cpp @@ -189,6 +189,17 @@ std::vector ResourceEntry::findAllValues(const ConfigDescr return results; } +std::vector ResourceEntry::findValuesIf( + const std::function& f) { + std::vector results; + for (auto& configValue : values) { + if (f(configValue.get())) { + results.push_back(configValue.get()); + } + } + return results; +} + /** * The default handler for collisions. A return value of -1 means keep the * existing value, 0 means fail, and +1 means take the incoming value. -- cgit v1.2.3-59-g8ed1b