blob: cffe8d5d803f23cb3b4db60175c6f876c08bee2a [file] [log] [blame]
Adam Lesinski6f6ceb72014-11-14 14:48:12 -08001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef AAPT_RESOURCE_H
18#define AAPT_RESOURCE_H
19
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080020#include <iomanip>
Adam Lesinskica2fc352015-04-03 12:08:26 -070021#include <limits>
Adam Lesinskid0f116b2016-07-08 15:00:32 -070022#include <sstream>
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080023#include <string>
24#include <tuple>
Adam Lesinski1ab598f2015-08-14 14:26:04 -070025#include <vector>
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080026
Adam Lesinskid5083f62017-01-16 15:07:21 -080027#include "androidfw/StringPiece.h"
Adam Lesinskice5e56e2016-10-21 17:56:45 -070028#include "utils/JenkinsHash.h"
29
30#include "ConfigDescription.h"
31#include "Source.h"
Adam Lesinskice5e56e2016-10-21 17:56:45 -070032
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080033namespace aapt {
34
35/**
36 * The various types of resource types available. Corresponds
37 * to the 'type' in package:type/entry.
38 */
39enum class ResourceType {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070040 kAnim,
41 kAnimator,
42 kArray,
43 kAttr,
44 kAttrPrivate,
45 kBool,
46 kColor,
Adam Lesinski86d67df2017-01-31 13:47:27 -080047
48 // Not really a type, but it shows up in some CTS tests and
49 // we need to continue respecting it.
50 kConfigVarying,
51
Adam Lesinskicacb28f2016-10-19 12:18:14 -070052 kDimen,
53 kDrawable,
Adam Lesinskic0c36632016-10-19 18:37:53 -070054 kFont,
Adam Lesinskicacb28f2016-10-19 12:18:14 -070055 kFraction,
56 kId,
57 kInteger,
58 kInterpolator,
59 kLayout,
60 kMenu,
61 kMipmap,
62 kPlurals,
63 kRaw,
64 kString,
65 kStyle,
66 kStyleable,
67 kTransition,
68 kXml,
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080069};
70
Adam Lesinskid5083f62017-01-16 15:07:21 -080071android::StringPiece ToString(ResourceType type);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080072
73/**
74 * Returns a pointer to a valid ResourceType, or nullptr if
75 * the string was invalid.
76 */
Adam Lesinskid5083f62017-01-16 15:07:21 -080077const ResourceType* ParseResourceType(const android::StringPiece& str);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080078
79/**
80 * A resource's name. This can uniquely identify
81 * a resource in the ResourceTable.
82 */
83struct ResourceName {
Adam Lesinskicacb28f2016-10-19 12:18:14 -070084 std::string package;
Adam Lesinskice5e56e2016-10-21 17:56:45 -070085 ResourceType type = ResourceType::kRaw;
Adam Lesinskicacb28f2016-10-19 12:18:14 -070086 std::string entry;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080087
Adam Lesinskice5e56e2016-10-21 17:56:45 -070088 ResourceName() = default;
Adam Lesinskid5083f62017-01-16 15:07:21 -080089 ResourceName(const android::StringPiece& p, ResourceType t, const android::StringPiece& e);
Adam Lesinski9ba47d82015-10-13 11:37:10 -070090
Adam Lesinskicacb28f2016-10-19 12:18:14 -070091 int compare(const ResourceName& other) const;
Adam Lesinski8197cc462016-08-19 12:16:49 -070092
Adam Lesinskice5e56e2016-10-21 17:56:45 -070093 bool is_valid() const;
94 std::string ToString() const;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -080095};
96
97/**
98 * Same as ResourceName, but uses StringPieces instead.
99 * Use this if you need to avoid copying and know that
100 * the lifetime of this object is shorter than that
101 * of the original string.
102 */
103struct ResourceNameRef {
Adam Lesinskid5083f62017-01-16 15:07:21 -0800104 android::StringPiece package;
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700105 ResourceType type = ResourceType::kRaw;
Adam Lesinskid5083f62017-01-16 15:07:21 -0800106 android::StringPiece entry;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800107
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700108 ResourceNameRef() = default;
109 ResourceNameRef(const ResourceNameRef&) = default;
110 ResourceNameRef(ResourceNameRef&&) = default;
111 ResourceNameRef(const ResourceName& rhs); // NOLINT(implicit)
Adam Lesinskid5083f62017-01-16 15:07:21 -0800112 ResourceNameRef(const android::StringPiece& p, ResourceType t, const android::StringPiece& e);
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700113 ResourceNameRef& operator=(const ResourceNameRef& rhs) = default;
114 ResourceNameRef& operator=(ResourceNameRef&& rhs) = default;
115 ResourceNameRef& operator=(const ResourceName& rhs);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800116
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700117 ResourceName ToResourceName() const;
118 bool is_valid() const;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800119};
120
121/**
122 * A binary identifier representing a resource. Internally it
123 * is a 32bit integer split as follows:
124 *
125 * 0xPPTTEEEE
126 *
127 * PP: 8 bit package identifier. 0x01 is reserved for system
128 * and 0x7f is reserved for the running app.
129 * TT: 8 bit type identifier. 0x00 is invalid.
130 * EEEE: 16 bit entry identifier.
131 */
132struct ResourceId {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700133 uint32_t id;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800134
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700135 ResourceId();
136 ResourceId(const ResourceId& rhs);
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700137 ResourceId(uint32_t res_id); // NOLINT(implicit)
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700138 ResourceId(uint8_t p, uint8_t t, uint16_t e);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800139
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700140 bool is_valid() const;
Adam Lesinskiceb9b2f2017-02-16 12:05:42 -0800141
142 // Returns true if the ID is a valid ID or dynamic ID (package ID can be 0).
143 bool is_valid_dynamic() const;
144
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700145 uint8_t package_id() const;
146 uint8_t type_id() const;
147 uint16_t entry_id() const;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800148};
149
Adam Lesinski1ab598f2015-08-14 14:26:04 -0700150struct SourcedResourceName {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700151 ResourceName name;
152 size_t line;
Adam Lesinski1ab598f2015-08-14 14:26:04 -0700153};
154
155struct ResourceFile {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700156 // Name
157 ResourceName name;
Adam Lesinski1ab598f2015-08-14 14:26:04 -0700158
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700159 // Configuration
160 ConfigDescription config;
Adam Lesinski1ab598f2015-08-14 14:26:04 -0700161
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700162 // Source
163 Source source;
Adam Lesinski1ab598f2015-08-14 14:26:04 -0700164
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700165 // Exported symbols
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700166 std::vector<SourcedResourceName> exported_symbols;
Adam Lesinski1ab598f2015-08-14 14:26:04 -0700167};
168
Adam Lesinskia6fe3452015-12-09 15:20:52 -0800169/**
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700170 * Useful struct used as a key to represent a unique resource in associative
171 * containers.
Adam Lesinskia6fe3452015-12-09 15:20:52 -0800172 */
173struct ResourceKey {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700174 ResourceName name;
175 ConfigDescription config;
Adam Lesinskia6fe3452015-12-09 15:20:52 -0800176};
177
178bool operator<(const ResourceKey& a, const ResourceKey& b);
179
180/**
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700181 * Useful struct used as a key to represent a unique resource in associative
182 * containers.
Adam Lesinskia6fe3452015-12-09 15:20:52 -0800183 * Holds a reference to the name, so that name better live longer than this key!
184 */
185struct ResourceKeyRef {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700186 ResourceNameRef name;
187 ConfigDescription config;
Adam Lesinskia6fe3452015-12-09 15:20:52 -0800188
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700189 ResourceKeyRef() = default;
190 ResourceKeyRef(const ResourceNameRef& n, const ConfigDescription& c)
191 : name(n), config(c) {}
Adam Lesinskia6fe3452015-12-09 15:20:52 -0800192
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700193 /**
194 * Prevent taking a reference to a temporary. This is bad.
195 */
196 ResourceKeyRef(ResourceName&& n, const ConfigDescription& c) = delete;
Adam Lesinskia6fe3452015-12-09 15:20:52 -0800197};
198
199bool operator<(const ResourceKeyRef& a, const ResourceKeyRef& b);
200
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800201//
202// ResourceId implementation.
203//
204
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700205inline ResourceId::ResourceId() : id(0) {}
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800206
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700207inline ResourceId::ResourceId(const ResourceId& rhs) : id(rhs.id) {}
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800208
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700209inline ResourceId::ResourceId(uint32_t res_id) : id(res_id) {}
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800210
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700211inline ResourceId::ResourceId(uint8_t p, uint8_t t, uint16_t e)
212 : id((p << 24) | (t << 16) | e) {}
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800213
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700214inline bool ResourceId::is_valid() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700215 return (id & 0xff000000u) != 0 && (id & 0x00ff0000u) != 0;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800216}
217
Adam Lesinskiceb9b2f2017-02-16 12:05:42 -0800218inline bool ResourceId::is_valid_dynamic() const { return (id & 0x00ff0000u) != 0; }
219
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700220inline uint8_t ResourceId::package_id() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700221 return static_cast<uint8_t>(id >> 24);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800222}
223
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700224inline uint8_t ResourceId::type_id() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700225 return static_cast<uint8_t>(id >> 16);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800226}
227
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700228inline uint16_t ResourceId::entry_id() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700229 return static_cast<uint16_t>(id);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800230}
231
Adam Lesinski74605cd2016-03-03 15:39:50 -0800232inline bool operator<(const ResourceId& lhs, const ResourceId& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700233 return lhs.id < rhs.id;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800234}
235
Adam Lesinski74605cd2016-03-03 15:39:50 -0800236inline bool operator>(const ResourceId& lhs, const ResourceId& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700237 return lhs.id > rhs.id;
Adam Lesinski24aad162015-04-24 19:19:30 -0700238}
239
Adam Lesinski74605cd2016-03-03 15:39:50 -0800240inline bool operator==(const ResourceId& lhs, const ResourceId& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700241 return lhs.id == rhs.id;
Adam Lesinski74605cd2016-03-03 15:39:50 -0800242}
243
244inline bool operator!=(const ResourceId& lhs, const ResourceId& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700245 return lhs.id != rhs.id;
Adam Lesinski74605cd2016-03-03 15:39:50 -0800246}
247
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700248inline ::std::ostream& operator<<(::std::ostream& out,
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700249 const ResourceId& res_id) {
250 std::ios_base::fmtflags old_flags = out.flags();
251 char old_fill = out.fill();
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700252 out << "0x" << std::internal << std::setfill('0') << std::setw(8) << std::hex
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700253 << res_id.id;
254 out.flags(old_flags);
255 out.fill(old_fill);
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700256 return out;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800257}
258
259//
260// ResourceType implementation.
261//
262
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700263inline ::std::ostream& operator<<(::std::ostream& out,
264 const ResourceType& val) {
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700265 return out << ToString(val);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800266}
267
268//
269// ResourceName implementation.
270//
271
Adam Lesinskid5083f62017-01-16 15:07:21 -0800272inline ResourceName::ResourceName(const android::StringPiece& p, ResourceType t,
273 const android::StringPiece& e)
274 : package(p.to_string()), type(t), entry(e.to_string()) {}
Adam Lesinski9ba47d82015-10-13 11:37:10 -0700275
Adam Lesinski8197cc462016-08-19 12:16:49 -0700276inline int ResourceName::compare(const ResourceName& other) const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700277 int cmp = package.compare(other.package);
278 if (cmp != 0) return cmp;
279 cmp = static_cast<int>(type) - static_cast<int>(other.type);
280 if (cmp != 0) return cmp;
281 cmp = entry.compare(other.entry);
282 return cmp;
Adam Lesinski8197cc462016-08-19 12:16:49 -0700283}
284
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700285inline bool ResourceName::is_valid() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700286 return !package.empty() && !entry.empty();
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800287}
288
Adam Lesinski74605cd2016-03-03 15:39:50 -0800289inline bool operator<(const ResourceName& lhs, const ResourceName& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700290 return std::tie(lhs.package, lhs.type, lhs.entry) <
291 std::tie(rhs.package, rhs.type, rhs.entry);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800292}
293
Adam Lesinski74605cd2016-03-03 15:39:50 -0800294inline bool operator==(const ResourceName& lhs, const ResourceName& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700295 return std::tie(lhs.package, lhs.type, lhs.entry) ==
296 std::tie(rhs.package, rhs.type, rhs.entry);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800297}
298
Adam Lesinski74605cd2016-03-03 15:39:50 -0800299inline bool operator!=(const ResourceName& lhs, const ResourceName& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700300 return std::tie(lhs.package, lhs.type, lhs.entry) !=
301 std::tie(rhs.package, rhs.type, rhs.entry);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800302}
303
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700304inline ::std::ostream& operator<<(::std::ostream& out,
305 const ResourceName& name) {
306 if (!name.package.empty()) {
307 out << name.package << ":";
308 }
309 return out << name.type << "/" << name.entry;
Adam Lesinski769de982015-04-10 19:43:55 -0700310}
311
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700312inline std::string ResourceName::ToString() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700313 std::stringstream stream;
314 stream << *this;
315 return stream.str();
Adam Lesinskid0f116b2016-07-08 15:00:32 -0700316}
Adam Lesinski769de982015-04-10 19:43:55 -0700317
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800318//
319// ResourceNameRef implementation.
320//
321
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700322inline ResourceNameRef::ResourceNameRef(const ResourceName& rhs)
323 : package(rhs.package), type(rhs.type), entry(rhs.entry) {}
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800324
Adam Lesinskid5083f62017-01-16 15:07:21 -0800325inline ResourceNameRef::ResourceNameRef(const android::StringPiece& p, ResourceType t,
326 const android::StringPiece& e)
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700327 : package(p), type(t), entry(e) {}
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800328
329inline ResourceNameRef& ResourceNameRef::operator=(const ResourceName& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700330 package = rhs.package;
331 type = rhs.type;
332 entry = rhs.entry;
333 return *this;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800334}
335
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700336inline ResourceName ResourceNameRef::ToResourceName() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700337 return ResourceName(package, type, entry);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800338}
339
Adam Lesinskice5e56e2016-10-21 17:56:45 -0700340inline bool ResourceNameRef::is_valid() const {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700341 return !package.empty() && !entry.empty();
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800342}
343
Adam Lesinski74605cd2016-03-03 15:39:50 -0800344inline bool operator<(const ResourceNameRef& lhs, const ResourceNameRef& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700345 return std::tie(lhs.package, lhs.type, lhs.entry) <
346 std::tie(rhs.package, rhs.type, rhs.entry);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800347}
348
Adam Lesinski74605cd2016-03-03 15:39:50 -0800349inline bool operator==(const ResourceNameRef& lhs, const ResourceNameRef& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700350 return std::tie(lhs.package, lhs.type, lhs.entry) ==
351 std::tie(rhs.package, rhs.type, rhs.entry);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800352}
353
Adam Lesinski74605cd2016-03-03 15:39:50 -0800354inline bool operator!=(const ResourceNameRef& lhs, const ResourceNameRef& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700355 return std::tie(lhs.package, lhs.type, lhs.entry) !=
356 std::tie(rhs.package, rhs.type, rhs.entry);
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800357}
358
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700359inline ::std::ostream& operator<<(::std::ostream& out,
360 const ResourceNameRef& name) {
361 if (!name.package.empty()) {
362 out << name.package << ":";
363 }
364 return out << name.type << "/" << name.entry;
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800365}
366
Adam Lesinski74605cd2016-03-03 15:39:50 -0800367inline bool operator<(const ResourceName& lhs, const ResourceNameRef& b) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700368 return ResourceNameRef(lhs) < b;
Adam Lesinski74605cd2016-03-03 15:39:50 -0800369}
370
371inline bool operator!=(const ResourceName& lhs, const ResourceNameRef& rhs) {
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700372 return ResourceNameRef(lhs) != rhs;
Adam Lesinski74605cd2016-03-03 15:39:50 -0800373}
374
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700375inline bool operator==(const SourcedResourceName& lhs,
376 const SourcedResourceName& rhs) {
377 return lhs.name == rhs.name && lhs.line == rhs.line;
Adam Lesinski74605cd2016-03-03 15:39:50 -0800378}
379
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700380} // namespace aapt
Adam Lesinski6f6ceb72014-11-14 14:48:12 -0800381
Adam Lesinskibf0bd0f2016-06-01 15:31:50 -0700382namespace std {
383
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700384template <>
385struct hash<aapt::ResourceName> {
386 size_t operator()(const aapt::ResourceName& name) const {
387 android::hash_t h = 0;
388 h = android::JenkinsHashMix(h, hash<string>()(name.package));
389 h = android::JenkinsHashMix(h, static_cast<uint32_t>(name.type));
390 h = android::JenkinsHashMix(h, hash<string>()(name.entry));
391 return static_cast<size_t>(h);
392 }
Adam Lesinskibf0bd0f2016-06-01 15:31:50 -0700393};
394
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700395} // namespace std
Adam Lesinskibf0bd0f2016-06-01 15:31:50 -0700396
Adam Lesinskicacb28f2016-10-19 12:18:14 -0700397#endif // AAPT_RESOURCE_H