diff options
author | 2023-08-23 02:22:53 +0000 | |
---|---|---|
committer | 2023-09-01 19:05:34 +0000 | |
commit | 804e819c1bf64d4df483107e02e896b29e58b3f1 (patch) | |
tree | 300e8f502c5ca18104016ebe30885d0aecf49125 /tools/aapt/FileFinder.cpp | |
parent | cc7212ddf54bc9ec55d1f08db39833a7c3d91078 (diff) |
Move String8 path functions to androidfw and aapt
Test: m checkbuild
Bug: 295394788
Change-Id: I9488bc5632cbd47c83f6b5f2df4c87eb324a1e8e
Diffstat (limited to 'tools/aapt/FileFinder.cpp')
-rw-r--r-- | tools/aapt/FileFinder.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/aapt/FileFinder.cpp b/tools/aapt/FileFinder.cpp index a5c19806c804..69a8fa9fc6f2 100644 --- a/tools/aapt/FileFinder.cpp +++ b/tools/aapt/FileFinder.cpp @@ -5,6 +5,7 @@ // File Finder implementation. // Implementation for the functions declared and documented in FileFinder.h +#include <androidfw/PathUtils.h> #include <utils/Vector.h> #include <utils/String8.h> #include <utils/KeyedVector.h> @@ -57,7 +58,7 @@ bool SystemFileFinder::findFiles(String8 basePath, Vector<String8>& extensions, if (entry->d_name[0] == '.') // Skip hidden files and directories continue; - String8 fullPath = basePath.appendPathCopy(entryName); + String8 fullPath = appendPathCopy(basePath, entryName); // If this entry is a directory we'll recurse into it if (isDirectory(fullPath.c_str()) ) { DirectoryWalker* copy = dw->clone(); @@ -83,10 +84,10 @@ void SystemFileFinder::checkAndAddFile(const String8& path, const struct stat* s { // Loop over the extensions, checking for a match bool done = false; - String8 ext(path.getPathExtension()); + String8 ext(getPathExtension(path)); ext.toLower(); for (size_t i = 0; i < extensions.size() && !done; ++i) { - String8 ext2 = extensions[i].getPathExtension(); + String8 ext2 = getPathExtension(extensions[i]); ext2.toLower(); // Compare the extensions. If a match is found, add to storage. if (ext == ext2) { |