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/Resource.h | |
parent | f9bd2944694539f1dce74d420156cc50bbb4af14 (diff) |
AAPT2: Shared library support
Test: make aapt2_tests
Change-Id: I98dddf1367e6c0ac425bb20be46e6ff05f4f2f45
Diffstat (limited to 'tools/aapt2/Resource.h')
-rw-r--r-- | tools/aapt2/Resource.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/aapt2/Resource.h b/tools/aapt2/Resource.h index 4d915d9f23c0..cffe8d5d803f 100644 --- a/tools/aapt2/Resource.h +++ b/tools/aapt2/Resource.h @@ -138,6 +138,10 @@ struct ResourceId { ResourceId(uint8_t p, uint8_t t, uint16_t e); bool is_valid() const; + + // Returns true if the ID is a valid ID or dynamic ID (package ID can be 0). + bool is_valid_dynamic() const; + uint8_t package_id() const; uint8_t type_id() const; uint16_t entry_id() const; @@ -211,6 +215,8 @@ inline bool ResourceId::is_valid() const { return (id & 0xff000000u) != 0 && (id & 0x00ff0000u) != 0; } +inline bool ResourceId::is_valid_dynamic() const { return (id & 0x00ff0000u) != 0; } + inline uint8_t ResourceId::package_id() const { return static_cast<uint8_t>(id >> 24); } |