summaryrefslogtreecommitdiff
path: root/tools/aapt2/Resource.h
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-10-13 11:37:10 -0700
committerAdam Lesinski <adamlesinski@google.com>2015-10-16 15:50:58 -0700
commit9ba47d813075fcb05c5e1532c137c93b394631cb (patch)
tree1eb9f7adc315ab8ad640249f8ac1888951520f3f /tools/aapt2/Resource.h
parent072c5bdff77e354bdf333c0c1d460cdd1c2e76ae (diff)
Filter products during compile phase
Unfortunately there is no good way to deal with products in the link phase. Products are like preprocessor defines in that they are processed early and change the composition of the compiled unit. Change-Id: I6d5e15ef60d29df8e83e059ba857c09333993779
Diffstat (limited to 'tools/aapt2/Resource.h')
-rw-r--r--tools/aapt2/Resource.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/aapt2/Resource.h b/tools/aapt2/Resource.h
index 31fe298670ae..7ef18973d89b 100644
--- a/tools/aapt2/Resource.h
+++ b/tools/aapt2/Resource.h
@@ -78,6 +78,9 @@ struct ResourceName {
ResourceType type;
std::u16string entry;
+ ResourceName() = default;
+ ResourceName(const StringPiece16& p, ResourceType t, const StringPiece16& e);
+
bool isValid() const;
bool operator<(const ResourceName& rhs) const;
bool operator==(const ResourceName& rhs) const;
@@ -226,6 +229,10 @@ inline ::std::ostream& operator<<(::std::ostream& out, const ResourceType& val)
// ResourceName implementation.
//
+inline ResourceName::ResourceName(const StringPiece16& p, ResourceType t, const StringPiece16& e) :
+ package(p.toString()), type(t), entry(e.toString()) {
+}
+
inline bool ResourceName::isValid() const {
return !package.empty() && !entry.empty();
}