From 4ffea040641d3b74ab04b6d2d3e78280bc893d5f Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Thu, 10 Aug 2017 15:37:28 -0700 Subject: AAPT2: Define intermediate compiled XML proto This proto format is meant to encapsulate more information that is specific to Android and allows for easier validation and manipulation across tools. Test: make aapt2_tests Change-Id: I13bc34a460671fc0a36246be0d287a3d37d244d6 --- tools/aapt2/ResourceValues.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tools/aapt2/ResourceValues.cpp') diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp index eb59175edf3b..1cba19462839 100644 --- a/tools/aapt2/ResourceValues.cpp +++ b/tools/aapt2/ResourceValues.cpp @@ -805,13 +805,12 @@ bool Array::Equals(const Value* value) const { return false; } - if (items.size() != other->items.size()) { + if (elements.size() != other->elements.size()) { return false; } - return std::equal(items.begin(), items.end(), other->items.begin(), - [](const std::unique_ptr& a, - const std::unique_ptr& b) -> bool { + return std::equal(elements.begin(), elements.end(), other->elements.begin(), + [](const std::unique_ptr& a, const std::unique_ptr& b) -> bool { return a->Equals(b.get()); }); } @@ -820,14 +819,14 @@ Array* Array::Clone(StringPool* new_pool) const { Array* array = new Array(); array->comment_ = comment_; array->source_ = source_; - for (auto& item : items) { - array->items.emplace_back(std::unique_ptr(item->Clone(new_pool))); + for (auto& item : elements) { + array->elements.emplace_back(std::unique_ptr(item->Clone(new_pool))); } return array; } void Array::Print(std::ostream* out) const { - *out << "(array) [" << util::Joiner(items, ", ") << "]"; + *out << "(array) [" << util::Joiner(elements, ", ") << "]"; } bool Plural::Equals(const Value* value) const { -- cgit v1.2.3-59-g8ed1b