diff options
author | Adam Lesinski <adamlesinski@google.com> | 2017-02-16 12:05:42 -0800 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2017-02-22 11:16:13 -0800 |
commit | ceb9b2f80f853059233cdd29057f39a5960a74ae (patch) | |
tree | 9093e8537319a97d8a2cbd8d4f0042c81de5ff8e /tools/aapt2/ResourceTable.h | |
parent | f9bd2944694539f1dce74d420156cc50bbb4af14 (diff) |
AAPT2: Shared library support
Test: make aapt2_tests
Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
Diffstat (limited to 'tools/aapt2/ResourceTable.h')
-rw-r--r-- | tools/aapt2/ResourceTable.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h index 0fe966c5089b..6b69aaf02cbe 100644 --- a/tools/aapt2/ResourceTable.h +++ b/tools/aapt2/ResourceTable.h @@ -158,11 +158,8 @@ class ResourceTableType { DISALLOW_COPY_AND_ASSIGN(ResourceTableType); }; -enum class PackageType { System, Vendor, App, Dynamic }; - class ResourceTablePackage { public: - PackageType type = PackageType::App; Maybe<uint8_t> id; std::string name; @@ -241,6 +238,19 @@ class ResourceTable { Maybe<SearchResult> FindResource(const ResourceNameRef& name); /** + * Returns the package struct with the given name, or nullptr if such a + * package does not + * exist. The empty string is a valid package and typically is used to + * represent the + * 'current' package before it is known to the ResourceTable. + */ + ResourceTablePackage* FindPackage(const android::StringPiece& name); + + ResourceTablePackage* FindPackageById(uint8_t id); + + ResourceTablePackage* CreatePackage(const android::StringPiece& name, Maybe<uint8_t> id = {}); + + /** * The string pool used by this resource table. Values that reference strings * must use * this pool to create their strings. @@ -259,18 +269,9 @@ class ResourceTable { */ std::vector<std::unique_ptr<ResourceTablePackage>> packages; - /** - * Returns the package struct with the given name, or nullptr if such a - * package does not - * exist. The empty string is a valid package and typically is used to - * represent the - * 'current' package before it is known to the ResourceTable. - */ - ResourceTablePackage* FindPackage(const android::StringPiece& name); - - ResourceTablePackage* FindPackageById(uint8_t id); - - ResourceTablePackage* CreatePackage(const android::StringPiece& name, Maybe<uint8_t> id = {}); + // Set of dynamic packages that this table may reference. Their package names get encoded + // into the resources.arsc along with their compile-time assigned IDs. + std::map<size_t, std::string> included_packages_; private: ResourceTablePackage* FindOrCreatePackage(const android::StringPiece& name); |