From 804e819c1bf64d4df483107e02e896b29e58b3f1 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 23 Aug 2023 02:22:53 +0000 Subject: Move String8 path functions to androidfw and aapt Test: m checkbuild Bug: 295394788 Change-Id: I9488bc5632cbd47c83f6b5f2df4c87eb324a1e8e --- tools/aapt/Package.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'tools/aapt/Package.cpp') diff --git a/tools/aapt/Package.cpp b/tools/aapt/Package.cpp index a7ff5fabf495..5e0f87f0dcaf 100644 --- a/tools/aapt/Package.cpp +++ b/tools/aapt/Package.cpp @@ -10,6 +10,7 @@ #include "ResourceFilter.h" #include "Utils.h" +#include #include #include @@ -170,7 +171,7 @@ status_t writeAPK(Bundle* bundle, const String8& outputFile, const sp /* anything here? */ if (zip->getNumEntries() == 0) { if (bundle->getVerbose()) { - printf("Archive is empty -- removing %s\n", outputFile.getPathLeaf().c_str()); + printf("Archive is empty -- removing %s\n", getPathLeaf(outputFile).c_str()); } delete zip; // close the file so we can remove it in Win32 zip = NULL; @@ -274,9 +275,9 @@ bool processFile(Bundle* bundle, ZipFile* zip, return true; } - if (strcasecmp(storageName.getPathExtension().c_str(), ".gz") == 0) { + if (strcasecmp(getPathExtension(storageName).c_str(), ".gz") == 0) { fromGzip = true; - storageName = storageName.getBasePath(); + storageName = getBasePath(storageName); } if (bundle->getUpdate()) { @@ -366,7 +367,7 @@ bool processFile(Bundle* bundle, ZipFile* zip, */ bool okayToCompress(Bundle* bundle, const String8& pathName) { - String8 ext = pathName.getPathExtension(); + String8 ext = getPathExtension(pathName); int i; if (ext.length() == 0) -- cgit v1.2.3-59-g8ed1b