diff options
Diffstat (limited to 'tools/aapt2/ResourceValues.cpp')
-rw-r--r-- | tools/aapt2/ResourceValues.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/tools/aapt2/ResourceValues.cpp b/tools/aapt2/ResourceValues.cpp index 2bf38e417cba..be0c3f366a10 100644 --- a/tools/aapt2/ResourceValues.cpp +++ b/tools/aapt2/ResourceValues.cpp @@ -101,8 +101,8 @@ bool Id::isWeak() const { } bool Id::flatten(android::Res_value& out) const { - out.dataType = android::Res_value::TYPE_NULL; - out.data = android::Res_value::DATA_NULL_UNDEFINED; + out.dataType = android::Res_value::TYPE_INT_BOOLEAN; + out.data = 0; return true; } @@ -231,17 +231,15 @@ Attribute* Attribute::clone(StringPool* /*newPool*/) const { return attr; } -void Attribute::print(std::ostream& out) const { - out << "(attr)"; +void Attribute::printMask(std::ostream& out) const { if (typeMask == android::ResTable_map::TYPE_ANY) { - out << " any"; + out << "any"; return; } bool set = false; if ((typeMask & android::ResTable_map::TYPE_REFERENCE) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -251,7 +249,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_STRING) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -261,7 +258,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_INTEGER) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -271,7 +267,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_BOOLEAN) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -281,7 +276,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_COLOR) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -291,7 +285,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_FLOAT) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -301,7 +294,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_DIMENSION) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -311,7 +303,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_FRACTION) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -321,7 +312,6 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_ENUM) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; @@ -331,13 +321,17 @@ void Attribute::print(std::ostream& out) const { if ((typeMask & android::ResTable_map::TYPE_FLAGS) != 0) { if (!set) { - out << " "; set = true; } else { out << "|"; } out << "flags"; } +} + +void Attribute::print(std::ostream& out) const { + out << "(attr) "; + printMask(out); out << " [" << util::joiner(symbols.begin(), symbols.end(), ", ") @@ -348,10 +342,6 @@ void Attribute::print(std::ostream& out) const { } } -static ::std::ostream& operator<<(::std::ostream& out, const Attribute::Symbol& s) { - return out << s.symbol.name.entry << "=" << s.value; -} - Style::Style(bool weak) : weak(weak) { } |