summaryrefslogtreecommitdiff
path: root/tools/aapt/CacheUpdater.h
diff options
context:
space:
mode:
author Tomasz Wasilczyk <twasilczyk@google.com> 2023-08-23 02:22:53 +0000
committer Tomasz Wasilczyk <twasilczyk@google.com> 2023-09-01 19:05:34 +0000
commit804e819c1bf64d4df483107e02e896b29e58b3f1 (patch)
tree300e8f502c5ca18104016ebe30885d0aecf49125 /tools/aapt/CacheUpdater.h
parentcc7212ddf54bc9ec55d1f08db39833a7c3d91078 (diff)
Move String8 path functions to androidfw and aapt
Test: m checkbuild Bug: 295394788 Change-Id: I9488bc5632cbd47c83f6b5f2df4c87eb324a1e8e
Diffstat (limited to 'tools/aapt/CacheUpdater.h')
-rw-r--r--tools/aapt/CacheUpdater.h11
1 files changed, 7 insertions, 4 deletions
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 <androidfw/PathUtils.h>
#include <utils/String8.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -16,6 +17,8 @@
#include <direct.h>
#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);
};