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
diff --git a/tools/aapt2/Resource.h b/tools/aapt2/Resource.h
index 31fe298..7ef1897 100644
--- a/tools/aapt2/Resource.h
+++ b/tools/aapt2/Resource.h
@@ -78,6 +78,9 @@
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 @@
// 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();
}