Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 1 | /* |
| 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_TABLE_H |
| 18 | #define AAPT_RESOURCE_TABLE_H |
| 19 | |
| 20 | #include "ConfigDescription.h" |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 21 | #include "Diagnostics.h" |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 22 | #include "Resource.h" |
| 23 | #include "ResourceValues.h" |
| 24 | #include "Source.h" |
| 25 | #include "StringPool.h" |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 26 | #include "io/File.h" |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 27 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 28 | #include <android-base/macros.h> |
Adam Lesinski | 458b877 | 2016-04-25 14:20:21 -0700 | [diff] [blame] | 29 | #include <functional> |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 30 | #include <map> |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 31 | #include <memory> |
| 32 | #include <string> |
| 33 | #include <tuple> |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 34 | #include <unordered_map> |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 35 | #include <vector> |
| 36 | |
| 37 | namespace aapt { |
| 38 | |
Adam Lesinski | 9e10ac7 | 2015-10-16 14:37:48 -0700 | [diff] [blame] | 39 | enum class SymbolState { |
| 40 | kUndefined, |
Adam Lesinski | 5c3464c | 2016-08-24 16:03:48 -0700 | [diff] [blame^] | 41 | kPrivate, |
Adam Lesinski | 9e10ac7 | 2015-10-16 14:37:48 -0700 | [diff] [blame] | 42 | kPublic, |
Adam Lesinski | 9e10ac7 | 2015-10-16 14:37:48 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 45 | /** |
| 46 | * The Public status of a resource. |
| 47 | */ |
Adam Lesinski | 9e10ac7 | 2015-10-16 14:37:48 -0700 | [diff] [blame] | 48 | struct Symbol { |
| 49 | SymbolState state = SymbolState::kUndefined; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 50 | Source source; |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 51 | std::string comment; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 52 | }; |
| 53 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 54 | class ResourceConfigValue { |
| 55 | public: |
| 56 | /** |
| 57 | * The configuration for which this value is defined. |
| 58 | */ |
| 59 | const ConfigDescription config; |
| 60 | |
| 61 | /** |
| 62 | * The product for which this value is defined. |
| 63 | */ |
| 64 | const std::string product; |
| 65 | |
| 66 | /** |
| 67 | * The actual Value. |
| 68 | */ |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 69 | std::unique_ptr<Value> value; |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 70 | |
| 71 | ResourceConfigValue(const ConfigDescription& config, const StringPiece& product) : |
| 72 | config(config), product(product.toString()) { } |
| 73 | |
| 74 | private: |
| 75 | DISALLOW_COPY_AND_ASSIGN(ResourceConfigValue); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | /** |
| 79 | * Represents a resource entry, which may have |
| 80 | * varying values for each defined configuration. |
| 81 | */ |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 82 | class ResourceEntry { |
| 83 | public: |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 84 | /** |
| 85 | * The name of the resource. Immutable, as |
| 86 | * this determines the order of this resource |
| 87 | * when doing lookups. |
| 88 | */ |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 89 | const std::string name; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 90 | |
| 91 | /** |
| 92 | * The entry ID for this resource. |
| 93 | */ |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 94 | Maybe<uint16_t> id; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 95 | |
| 96 | /** |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 97 | * Whether this resource is public (and must maintain the same entry ID across builds). |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 98 | */ |
Adam Lesinski | 9e10ac7 | 2015-10-16 14:37:48 -0700 | [diff] [blame] | 99 | Symbol symbolStatus; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 100 | |
| 101 | /** |
| 102 | * The resource's values for each configuration. |
| 103 | */ |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 104 | std::vector<std::unique_ptr<ResourceConfigValue>> values; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 105 | |
Chih-Hung Hsieh | 9b8528f | 2016-08-10 14:15:30 -0700 | [diff] [blame] | 106 | explicit ResourceEntry(const StringPiece& name) : name(name.toString()) { } |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 107 | |
| 108 | ResourceConfigValue* findValue(const ConfigDescription& config); |
| 109 | ResourceConfigValue* findValue(const ConfigDescription& config, const StringPiece& product); |
| 110 | ResourceConfigValue* findOrCreateValue(const ConfigDescription& config, |
| 111 | const StringPiece& product); |
| 112 | std::vector<ResourceConfigValue*> findAllValues(const ConfigDescription& config); |
Adam Lesinski | 458b877 | 2016-04-25 14:20:21 -0700 | [diff] [blame] | 113 | std::vector<ResourceConfigValue*> findValuesIf( |
| 114 | const std::function<bool(ResourceConfigValue*)>& f); |
| 115 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 116 | |
| 117 | private: |
| 118 | DISALLOW_COPY_AND_ASSIGN(ResourceEntry); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 119 | }; |
| 120 | |
| 121 | /** |
| 122 | * Represents a resource type, which holds entries defined |
| 123 | * for this type. |
| 124 | */ |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 125 | class ResourceTableType { |
| 126 | public: |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 127 | /** |
| 128 | * The logical type of resource (string, drawable, layout, etc.). |
| 129 | */ |
| 130 | const ResourceType type; |
| 131 | |
| 132 | /** |
| 133 | * The type ID for this resource. |
| 134 | */ |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 135 | Maybe<uint8_t> id; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 136 | |
| 137 | /** |
| 138 | * Whether this type is public (and must maintain the same |
| 139 | * type ID across builds). |
| 140 | */ |
Adam Lesinski | 9e10ac7 | 2015-10-16 14:37:48 -0700 | [diff] [blame] | 141 | Symbol symbolStatus; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 142 | |
| 143 | /** |
| 144 | * List of resources for this type. |
| 145 | */ |
| 146 | std::vector<std::unique_ptr<ResourceEntry>> entries; |
| 147 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 148 | explicit ResourceTableType(const ResourceType type) : type(type) { } |
| 149 | |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 150 | ResourceEntry* findEntry(const StringPiece& name); |
| 151 | ResourceEntry* findOrCreateEntry(const StringPiece& name); |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 152 | |
| 153 | private: |
| 154 | DISALLOW_COPY_AND_ASSIGN(ResourceTableType); |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | enum class PackageType { |
| 158 | System, |
| 159 | Vendor, |
| 160 | App, |
| 161 | Dynamic |
| 162 | }; |
| 163 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 164 | class ResourceTablePackage { |
| 165 | public: |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 166 | PackageType type = PackageType::App; |
| 167 | Maybe<uint8_t> id; |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 168 | std::string name; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 169 | |
| 170 | std::vector<std::unique_ptr<ResourceTableType>> types; |
| 171 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 172 | ResourceTablePackage() = default; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 173 | ResourceTableType* findType(ResourceType type); |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 174 | ResourceTableType* findOrCreateType(const ResourceType type); |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 175 | |
| 176 | private: |
| 177 | DISALLOW_COPY_AND_ASSIGN(ResourceTablePackage); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 178 | }; |
| 179 | |
| 180 | /** |
| 181 | * The container and index for all resources defined for an app. This gets |
| 182 | * flattened into a binary resource table (resources.arsc). |
| 183 | */ |
| 184 | class ResourceTable { |
| 185 | public: |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 186 | ResourceTable() = default; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 187 | |
Adam Lesinski | 5c3464c | 2016-08-24 16:03:48 -0700 | [diff] [blame^] | 188 | enum class CollisionResult { |
| 189 | kKeepOriginal, |
| 190 | kConflict, |
| 191 | kTakeNew |
| 192 | }; |
| 193 | |
| 194 | using CollisionResolverFunc = std::function<CollisionResult(Value*, Value*)>; |
| 195 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 196 | /** |
| 197 | * When a collision of resources occurs, this method decides which value to keep. |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 198 | */ |
Adam Lesinski | 5c3464c | 2016-08-24 16:03:48 -0700 | [diff] [blame^] | 199 | static CollisionResult resolveValueCollision(Value* existing, Value* incoming); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 200 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 201 | bool addResource(const ResourceNameRef& name, |
| 202 | const ConfigDescription& config, |
| 203 | const StringPiece& product, |
| 204 | std::unique_ptr<Value> value, |
Adam Lesinski | e78fd61 | 2015-10-22 12:48:43 -0700 | [diff] [blame] | 205 | IDiagnostics* diag); |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 206 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 207 | bool addResource(const ResourceNameRef& name, |
Chih-Hung Hsieh | 9b8528f | 2016-08-10 14:15:30 -0700 | [diff] [blame] | 208 | const ResourceId& resId, |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 209 | const ConfigDescription& config, |
| 210 | const StringPiece& product, |
| 211 | std::unique_ptr<Value> value, |
| 212 | IDiagnostics* diag); |
| 213 | |
| 214 | bool addFileReference(const ResourceNameRef& name, |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 215 | const ConfigDescription& config, |
| 216 | const Source& source, |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 217 | const StringPiece& path, |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 218 | IDiagnostics* diag); |
Adam Lesinski | fb48d29 | 2015-11-07 15:52:13 -0800 | [diff] [blame] | 219 | |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 220 | bool addFileReferenceAllowMangled(const ResourceNameRef& name, |
| 221 | const ConfigDescription& config, |
| 222 | const Source& source, |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 223 | const StringPiece& path, |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 224 | io::IFile* file, |
| 225 | IDiagnostics* diag); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 226 | |
Adam Lesinski | 330edcd | 2015-05-04 17:40:56 -0700 | [diff] [blame] | 227 | /** |
| 228 | * Same as addResource, but doesn't verify the validity of the name. This is used |
| 229 | * when loading resources from an existing binary resource table that may have mangled |
| 230 | * names. |
| 231 | */ |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 232 | bool addResourceAllowMangled(const ResourceNameRef& name, |
| 233 | const ConfigDescription& config, |
| 234 | const StringPiece& product, |
| 235 | std::unique_ptr<Value> value, |
Adam Lesinski | 9e10ac7 | 2015-10-16 14:37:48 -0700 | [diff] [blame] | 236 | IDiagnostics* diag); |
| 237 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 238 | bool addResourceAllowMangled(const ResourceNameRef& name, |
Chih-Hung Hsieh | 9b8528f | 2016-08-10 14:15:30 -0700 | [diff] [blame] | 239 | const ResourceId& id, |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 240 | const ConfigDescription& config, |
| 241 | const StringPiece& product, |
| 242 | std::unique_ptr<Value> value, |
| 243 | IDiagnostics* diag); |
Adam Lesinski | e78fd61 | 2015-10-22 12:48:43 -0700 | [diff] [blame] | 244 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 245 | bool setSymbolState(const ResourceNameRef& name, |
Chih-Hung Hsieh | 9b8528f | 2016-08-10 14:15:30 -0700 | [diff] [blame] | 246 | const ResourceId& resId, |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 247 | const Symbol& symbol, |
| 248 | IDiagnostics* diag); |
| 249 | |
| 250 | bool setSymbolStateAllowMangled(const ResourceNameRef& name, |
Chih-Hung Hsieh | 9b8528f | 2016-08-10 14:15:30 -0700 | [diff] [blame] | 251 | const ResourceId& resId, |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 252 | const Symbol& symbol, |
| 253 | IDiagnostics* diag); |
Adam Lesinski | e78fd61 | 2015-10-22 12:48:43 -0700 | [diff] [blame] | 254 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 255 | struct SearchResult { |
Adam Lesinski | 9ba47d8 | 2015-10-13 11:37:10 -0700 | [diff] [blame] | 256 | ResourceTablePackage* package; |
| 257 | ResourceTableType* type; |
| 258 | ResourceEntry* entry; |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 259 | }; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 260 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 261 | Maybe<SearchResult> findResource(const ResourceNameRef& name); |
Adam Lesinski | 769de98 | 2015-04-10 19:43:55 -0700 | [diff] [blame] | 262 | |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 263 | /** |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 264 | * The string pool used by this resource table. Values that reference strings must use |
| 265 | * this pool to create their strings. |
| 266 | * |
| 267 | * NOTE: `stringPool` must come before `packages` so that it is destroyed after. |
| 268 | * When `string pool` references are destroyed (as they will be when `packages` |
| 269 | * is destroyed), they decrement a refCount, which would cause invalid |
| 270 | * memory access if the pool was already destroyed. |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 271 | */ |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 272 | StringPool stringPool; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 273 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 274 | /** |
| 275 | * The list of packages in this table, sorted alphabetically by package name. |
| 276 | */ |
| 277 | std::vector<std::unique_ptr<ResourceTablePackage>> packages; |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 278 | |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 279 | /** |
| 280 | * Returns the package struct with the given name, or nullptr if such a package does not |
| 281 | * exist. The empty string is a valid package and typically is used to represent the |
| 282 | * 'current' package before it is known to the ResourceTable. |
| 283 | */ |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 284 | ResourceTablePackage* findPackage(const StringPiece& name); |
Adam Lesinski | 1ab598f | 2015-08-14 14:26:04 -0700 | [diff] [blame] | 285 | |
| 286 | ResourceTablePackage* findPackageById(uint8_t id); |
| 287 | |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 288 | ResourceTablePackage* createPackage(const StringPiece& name, Maybe<uint8_t> id = {}); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 289 | |
| 290 | private: |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 291 | ResourceTablePackage* findOrCreatePackage(const StringPiece& name); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 292 | |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 293 | bool addFileReferenceImpl(const ResourceNameRef& name, |
| 294 | const ConfigDescription& config, |
| 295 | const Source& source, |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 296 | const StringPiece& path, |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 297 | io::IFile* file, |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 298 | const char* validChars, |
Adam Lesinski | 355f285 | 2016-02-13 20:26:45 -0800 | [diff] [blame] | 299 | IDiagnostics* diag); |
| 300 | |
Adam Lesinski | fb48d29 | 2015-11-07 15:52:13 -0800 | [diff] [blame] | 301 | bool addResourceImpl(const ResourceNameRef& name, |
Chih-Hung Hsieh | 9b8528f | 2016-08-10 14:15:30 -0700 | [diff] [blame] | 302 | const ResourceId& resId, |
Adam Lesinski | fb48d29 | 2015-11-07 15:52:13 -0800 | [diff] [blame] | 303 | const ConfigDescription& config, |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 304 | const StringPiece& product, |
Adam Lesinski | fb48d29 | 2015-11-07 15:52:13 -0800 | [diff] [blame] | 305 | std::unique_ptr<Value> value, |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 306 | const char* validChars, |
Adam Lesinski | 5c3464c | 2016-08-24 16:03:48 -0700 | [diff] [blame^] | 307 | const CollisionResolverFunc& conflictResolver, |
Adam Lesinski | fb48d29 | 2015-11-07 15:52:13 -0800 | [diff] [blame] | 308 | IDiagnostics* diag); |
| 309 | |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 310 | bool setSymbolStateImpl(const ResourceNameRef& name, |
Chih-Hung Hsieh | 9b8528f | 2016-08-10 14:15:30 -0700 | [diff] [blame] | 311 | const ResourceId& resId, |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 312 | const Symbol& symbol, |
Adam Lesinski | d0f116b | 2016-07-08 15:00:32 -0700 | [diff] [blame] | 313 | const char* validChars, |
Adam Lesinski | e4bb9eb | 2016-02-12 22:18:51 -0800 | [diff] [blame] | 314 | IDiagnostics* diag); |
| 315 | |
| 316 | DISALLOW_COPY_AND_ASSIGN(ResourceTable); |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 317 | }; |
| 318 | |
Adam Lesinski | 6f6ceb7 | 2014-11-14 14:48:12 -0800 | [diff] [blame] | 319 | } // namespace aapt |
| 320 | |
| 321 | #endif // AAPT_RESOURCE_TABLE_H |