summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceUtils.cpp
diff options
context:
space:
mode:
author Adam Lesinski <adamlesinski@google.com> 2015-11-02 16:10:55 -0800
committer Adam Lesinski <adamlesinski@google.com> 2015-11-02 16:56:34 -0800
commit2ae4a877d1623f851040ce69239552c873f1abf0 (patch)
treeb13fd89771d05c8f5471218695c9eff5ab287b23 /tools/aapt2/ResourceUtils.cpp
parent3b4cd94034ff3e5567a2ba6da35d640ff61db4b9 (diff)
AAPT2: Add Manifest fixing/validation
Change-Id: I7f6d8b74d1c590adc356b4da55cb6cb777cdf1da
Diffstat (limited to 'tools/aapt2/ResourceUtils.cpp')
-rw-r--r--tools/aapt2/ResourceUtils.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/aapt2/ResourceUtils.cpp b/tools/aapt2/ResourceUtils.cpp
index 0db1c372c901..ae3b4ff1e363 100644
--- a/tools/aapt2/ResourceUtils.cpp
+++ b/tools/aapt2/ResourceUtils.cpp
@@ -74,9 +74,11 @@ bool tryParseReference(const StringPiece16& str, ResourceNameRef* outRef, bool*
return false;
}
- outRef->package = package;
- outRef->type = *parsedType;
- outRef->entry = entry;
+ if (outRef != nullptr) {
+ outRef->package = package;
+ outRef->type = *parsedType;
+ outRef->entry = entry;
+ }
if (outCreate) {
*outCreate = create;
}
@@ -88,6 +90,10 @@ bool tryParseReference(const StringPiece16& str, ResourceNameRef* outRef, bool*
return false;
}
+bool isReference(const StringPiece16& str) {
+ return tryParseReference(str, nullptr, nullptr, nullptr);
+}
+
bool tryParseAttributeReference(const StringPiece16& str, ResourceNameRef* outRef) {
StringPiece16 trimmedStr(util::trimWhitespace(str));
if (trimmedStr.empty()) {