Move StringPiece to libandroidfw
libandroidfw needs to make use of StringPiece, so
move it to libandroidfw and update all code referencing
StringPiece in aapt2.
Test: make libandroidfw_tests libaapt2_tests
Change-Id: I68d7f0fc7c651b048d9d1f5e7971f10ef5349fa1
diff --git a/tools/aapt2/xml/XmlDom.h b/tools/aapt2/xml/XmlDom.h
index 720fe35..90cdfb6 100644
--- a/tools/aapt2/xml/XmlDom.h
+++ b/tools/aapt2/xml/XmlDom.h
@@ -22,10 +22,11 @@
#include <string>
#include <vector>
+#include "androidfw/StringPiece.h"
+
#include "Diagnostics.h"
#include "Resource.h"
#include "ResourceValues.h"
-#include "util/StringPiece.h"
#include "util/Util.h"
#include "xml/XmlUtil.h"
@@ -100,13 +101,13 @@
std::string name;
std::vector<Attribute> attributes;
- Attribute* FindAttribute(const StringPiece& ns, const StringPiece& name);
- xml::Element* FindChild(const StringPiece& ns, const StringPiece& name);
- xml::Element* FindChildWithAttribute(const StringPiece& ns,
- const StringPiece& name,
- const StringPiece& attr_ns,
- const StringPiece& attr_name,
- const StringPiece& attr_value);
+ Attribute* FindAttribute(const android::StringPiece& ns, const android::StringPiece& name);
+ xml::Element* FindChild(const android::StringPiece& ns, const android::StringPiece& name);
+ xml::Element* FindChildWithAttribute(const android::StringPiece& ns,
+ const android::StringPiece& name,
+ const android::StringPiece& attr_ns,
+ const android::StringPiece& attr_name,
+ const android::StringPiece& attr_value);
std::vector<xml::Element*> GetChildElements();
std::unique_ptr<Node> Clone() override;
};
@@ -190,8 +191,7 @@
void Visit(Namespace* ns) override;
Maybe<ExtractedPackage> TransformPackageAlias(
- const StringPiece& alias,
- const StringPiece& local_package) const override;
+ const android::StringPiece& alias, const android::StringPiece& local_package) const override;
private:
struct PackageDecl {