summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceTable.h
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-10-22 12:48:43 -0700
committerAdam Lesinski <adamlesinski@google.com>2015-10-22 16:35:47 -0700
commite78fd617ec60139a973a01925fa7adad31febb39 (patch)
treeb64f9590b16dfb2e6e9ea8bf2eb5d54a02230b0a /tools/aapt2/ResourceTable.h
parent3b7acbb86207df78eccfeb40aabcc8543703a58f (diff)
AAPT2: Move comments and source into Value
Values are closely related to where they were defined, so this information should live inside the Value. This also enables comments to be attached to nested Values. Change-Id: Ic7481b5a5f26d0ef248d638e2e29252f88154581
Diffstat (limited to 'tools/aapt2/ResourceTable.h')
-rw-r--r--tools/aapt2/ResourceTable.h37
1 files changed, 16 insertions, 21 deletions
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h
index be909361bef1..980504be377b 100644
--- a/tools/aapt2/ResourceTable.h
+++ b/tools/aapt2/ResourceTable.h
@@ -47,12 +47,10 @@ struct Symbol {
};
/**
- * The resource value for a specific configuration.
+ * Represents a value defined for a given configuration.
*/
struct ResourceConfigValue {
ConfigDescription config;
- Source source;
- std::u16string comment;
std::unique_ptr<Value> value;
};
@@ -158,12 +156,11 @@ public:
static int resolveValueCollision(Value* existing, Value* incoming);
bool addResource(const ResourceNameRef& name, const ConfigDescription& config,
- const Source& source, std::unique_ptr<Value> value,
- IDiagnostics* diag);
+ std::unique_ptr<Value> value, IDiagnostics* diag);
bool addResource(const ResourceNameRef& name, const ResourceId resId,
- const ConfigDescription& config, const Source& source,
- std::unique_ptr<Value> value, IDiagnostics* diag);
+ const ConfigDescription& config, std::unique_ptr<Value> value,
+ IDiagnostics* diag);
bool addFileReference(const ResourceNameRef& name, const ConfigDescription& config,
const Source& source, const StringPiece16& path, IDiagnostics* diag);
@@ -174,18 +171,18 @@ public:
* names.
*/
bool addResourceAllowMangled(const ResourceNameRef& name, const ConfigDescription& config,
- const Source& source, std::unique_ptr<Value> value,
- IDiagnostics* diag);
+ std::unique_ptr<Value> value, IDiagnostics* diag);
bool addResourceAllowMangled(const ResourceNameRef& name, const ResourceId id,
- const ConfigDescription& config,
- const Source& source, std::unique_ptr<Value> value,
+ const ConfigDescription& config, std::unique_ptr<Value> value,
IDiagnostics* diag);
- bool setSymbolState(const ResourceNameRef& name, const ResourceId resId, const Source& source,
- SymbolState state, IDiagnostics* diag);
+ bool setSymbolState(const ResourceNameRef& name, const ResourceId resId,
+ const Symbol& symbol, IDiagnostics* diag);
+
bool setSymbolStateAllowMangled(const ResourceNameRef& name, const ResourceId resId,
- const Source& source, SymbolState state, IDiagnostics* diag);
+ const Symbol& symbol, IDiagnostics* diag);
+
struct SearchResult {
ResourceTablePackage* package;
ResourceTableType* type;
@@ -224,13 +221,11 @@ public:
private:
ResourceTablePackage* findOrCreatePackage(const StringPiece16& name);
- bool addResourceImpl(const ResourceNameRef& name, const ResourceId resId,
- const ConfigDescription& config, const Source& source,
- std::unique_ptr<Value> value, const char16_t* validChars,
- IDiagnostics* diag);
- bool setSymbolStateImpl(const ResourceNameRef& name, const ResourceId resId,
- const Source& source, SymbolState state, const char16_t* validChars,
- IDiagnostics* diag);
+ bool addResourceImpl(const ResourceNameRef& name, ResourceId resId,
+ const ConfigDescription& config, std::unique_ptr<Value> value,
+ const char16_t* validChars, IDiagnostics* diag);
+ bool setSymbolStateImpl(const ResourceNameRef& name, ResourceId resId,
+ const Symbol& symbol, const char16_t* validChars, IDiagnostics* diag);
};
} // namespace aapt