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/CacheUpdater.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'tools/aapt/CacheUpdater.h') diff --git a/tools/aapt/CacheUpdater.h b/tools/aapt/CacheUpdater.h index 2dc143c6a66d..dc5493f9e500 100644 --- a/tools/aapt/CacheUpdater.h +++ b/tools/aapt/CacheUpdater.h @@ -7,6 +7,7 @@ #ifndef CACHE_UPDATER_H #define CACHE_UPDATER_H +#include #include #include #include @@ -16,6 +17,8 @@ #include #endif +#include "Utils.h" + using namespace android; /** CacheUpdater @@ -72,14 +75,14 @@ public: do { // As we remove the end of existsPath add it to // the string of paths to create. - toCreate = existsPath.getPathLeaf().appendPath(toCreate); - existsPath = existsPath.getPathDir(); + toCreate = appendPathCopy(getPathLeaf(existsPath), toCreate); + existsPath = getPathDir(existsPath); } while (stat(existsPath.c_str(),&s) == -1); // Walk forwards and build directories as we go do { // Advance to the next segment of the path - existsPath.appendPath(toCreate.walkPath(&remains)); + appendPath(existsPath, walkPath(toCreate, &remains)); toCreate = remains; #ifdef _WIN32 _mkdir(existsPath.c_str()); @@ -101,7 +104,7 @@ public: virtual void processImage(String8 source, String8 dest) { // Make sure we're trying to write to a directory that is extant - ensureDirectoriesExist(dest.getPathDir()); + ensureDirectoriesExist(getPathDir(dest)); preProcessImageToCache(bundle, source, dest); }; -- cgit v1.2.3-59-g8ed1b