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/link/TableMerger.cpp b/tools/aapt2/link/TableMerger.cpp
index d808da3..7e7b9fb 100644
--- a/tools/aapt2/link/TableMerger.cpp
+++ b/tools/aapt2/link/TableMerger.cpp
@@ -24,6 +24,8 @@
#include "ValueVisitor.h"
#include "util/Util.h"
+using android::StringPiece;
+
namespace aapt {
TableMerger::TableMerger(IAaptContext* context, ResourceTable* out_table,
@@ -351,9 +353,8 @@
const std::string& package, const FileReference& file_ref) {
StringPiece prefix, entry, suffix;
if (util::ExtractResFilePathParts(*file_ref.path, &prefix, &entry, &suffix)) {
- std::string mangled_entry =
- NameMangler::MangleEntry(package, entry.ToString());
- std::string newPath = prefix.ToString() + mangled_entry + suffix.ToString();
+ std::string mangled_entry = NameMangler::MangleEntry(package, entry.to_string());
+ std::string newPath = prefix.to_string() + mangled_entry + suffix.to_string();
std::unique_ptr<FileReference> new_file_ref =
util::make_unique<FileReference>(
master_table_->string_pool.MakeRef(newPath));