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/io/ZipArchive.cpp b/tools/aapt2/io/ZipArchive.cpp
index f4a128e..62b436f 100644
--- a/tools/aapt2/io/ZipArchive.cpp
+++ b/tools/aapt2/io/ZipArchive.cpp
@@ -22,6 +22,8 @@
#include "Source.h"
#include "util/Util.h"
+using android::StringPiece;
+
namespace aapt {
namespace io {
@@ -107,7 +109,7 @@
std::string zip_entry_path =
std::string(reinterpret_cast<const char*>(zip_entry_name.name),
zip_entry_name.name_length);
- std::string nested_path = path.ToString() + "@" + zip_entry_path;
+ std::string nested_path = path.to_string() + "@" + zip_entry_path;
collection->files_[zip_entry_path] = util::make_unique<ZipFile>(
collection->handle_, zip_data, Source(nested_path));
}
@@ -120,7 +122,7 @@
}
IFile* ZipFileCollection::FindFile(const StringPiece& path) {
- auto iter = files_.find(path.ToString());
+ auto iter = files_.find(path.to_string());
if (iter != files_.end()) {
return iter->second.get();
}