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
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <tuple>
|
||||
|
||||
#include "android-base/logging.h"
|
||||
#include "androidfw/StringPiece.h"
|
||||
|
||||
#include "NameMangler.h"
|
||||
#include "Resource.h"
|
||||
@@ -32,7 +33,8 @@
|
||||
#include "java/AnnotationProcessor.h"
|
||||
#include "java/ClassDefinition.h"
|
||||
#include "process/SymbolTable.h"
|
||||
#include "util/StringPiece.h"
|
||||
|
||||
using android::StringPiece;
|
||||
|
||||
namespace aapt {
|
||||
|
||||
@@ -58,7 +60,7 @@ static bool IsValidSymbol(const StringPiece& symbol) {
|
||||
* Replace those with '_'.
|
||||
*/
|
||||
static std::string Transform(const StringPiece& symbol) {
|
||||
std::string output = symbol.ToString();
|
||||
std::string output = symbol.to_string();
|
||||
for (char& c : output) {
|
||||
if (c == '.' || c == '-') {
|
||||
c = '_';
|
||||
|
||||
Reference in New Issue
Block a user