summaryrefslogtreecommitdiff
path: root/tools/aapt2/Resource.h
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-04-24 19:19:30 -0700
committerAdam Lesinski <adamlesinski@google.com>2015-05-04 16:43:24 -0700
commit24aad163bc88cb10d2275385e9afc3de7f342d65 (patch)
tree361fc0b3fbef5f68a16f357ae9d2bed5e93efbf5 /tools/aapt2/Resource.h
parentab2581398c812917145088590bd18eb83f3a2ea6 (diff)
Add namespace handling in attribute values
Previously, you could only reference namespace prefixes in attribute names: <View xmlns:appcompat="http://schemas.android.com/apk/res/android.support.v7.appcompat" appcompat:name="hey" ... Now you can also reference them in resource names within an attribute value: ... android:text="@appcompat:string/confirm" ... Which will be treated as "@android.support.v7.appcompat:string/confirm". Change-Id: Ib076e867a990c80cf877a704eb77cd1ef0b23b52
Diffstat (limited to 'tools/aapt2/Resource.h')
-rw-r--r--tools/aapt2/Resource.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/aapt2/Resource.h b/tools/aapt2/Resource.h
index f928acd7c8d7..31104fbe91b6 100644
--- a/tools/aapt2/Resource.h
+++ b/tools/aapt2/Resource.h
@@ -130,6 +130,7 @@ struct ResourceId {
uint8_t typeId() const;
uint16_t entryId() const;
bool operator<(const ResourceId& rhs) const;
+ bool operator==(const ResourceId& rhs) const;
};
//
@@ -178,6 +179,10 @@ inline bool ResourceId::operator<(const ResourceId& rhs) const {
return id < rhs.id;
}
+inline bool ResourceId::operator==(const ResourceId& rhs) const {
+ return id == rhs.id;
+}
+
inline ::std::ostream& operator<<(::std::ostream& out,
const ResourceId& resId) {
std::ios_base::fmtflags oldFlags = out.flags();