summaryrefslogtreecommitdiffstats
path: root/src/common/fs/fs.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-06-16 03:39:14 +0200
committerGitHub <noreply@github.com>2023-06-16 03:39:14 +0200
commit9a04793ae865b7dba009d3133950636eb7ede845 (patch)
tree4fa07212a74c4a7409374e18b1e2442d65f929cd /src/common/fs/fs.cpp
parentMerge pull request #10790 from liamwhite/arm-driver-moment (diff)
parentandroid: fs: Fix Exists / IsFile for SAF. (diff)
downloadyuzu-9a04793ae865b7dba009d3133950636eb7ede845.tar
yuzu-9a04793ae865b7dba009d3133950636eb7ede845.tar.gz
yuzu-9a04793ae865b7dba009d3133950636eb7ede845.tar.bz2
yuzu-9a04793ae865b7dba009d3133950636eb7ede845.tar.lz
yuzu-9a04793ae865b7dba009d3133950636eb7ede845.tar.xz
yuzu-9a04793ae865b7dba009d3133950636eb7ede845.tar.zst
yuzu-9a04793ae865b7dba009d3133950636eb7ede845.zip
Diffstat (limited to '')
-rw-r--r--src/common/fs/fs.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/common/fs/fs.cpp b/src/common/fs/fs.cpp
index e1716c62d..6d66c926d 100644
--- a/src/common/fs/fs.cpp
+++ b/src/common/fs/fs.cpp
@@ -3,6 +3,9 @@
#include "common/fs/file.h"
#include "common/fs/fs.h"
+#ifdef ANDROID
+#include "common/fs/fs_android.h"
+#endif
#include "common/fs/path_util.h"
#include "common/logging/log.h"
@@ -525,15 +528,39 @@ void IterateDirEntriesRecursively(const std::filesystem::path& path,
// Generic Filesystem Operations
bool Exists(const fs::path& path) {
+#ifdef ANDROID
+ if (Android::IsContentUri(path)) {
+ return Android::Exists(path);
+ } else {
+ return fs::exists(path);
+ }
+#else
return fs::exists(path);
+#endif
}
bool IsFile(const fs::path& path) {
+#ifdef ANDROID
+ if (Android::IsContentUri(path)) {
+ return !Android::IsDirectory(path);
+ } else {
+ return fs::is_regular_file(path);
+ }
+#else
return fs::is_regular_file(path);
+#endif
}
bool IsDir(const fs::path& path) {
+#ifdef ANDROID
+ if (Android::IsContentUri(path)) {
+ return Android::IsDirectory(path);
+ } else {
+ return fs::is_directory(path);
+ }
+#else
return fs::is_directory(path);
+#endif
}
fs::path GetCurrentDir() {