diff options
| author | JMC47 <JMC4789@gmail.com> | 2020-09-23 12:27:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-23 12:27:43 -0400 |
| commit | 54e570a95f2cb54fdc7be29d04870746c69a8b9e (patch) | |
| tree | 1db68bbdaa591d6cd8025493478fa5d0dadf7980 /Source/Core/Common/FileUtil.cpp | |
| parent | f33767f19cca6ee95af9727f0050f27e2571f770 (diff) | |
| parent | 5ba083215852a7f1afa2ac73316c2c0c500a6e7d (diff) | |
Merge pull request #8902 from JosJuice/android-convert
Android: Add disc image conversion
Diffstat (limited to 'Source/Core/Common/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/FileUtil.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/Core/Common/FileUtil.cpp b/Source/Core/Common/FileUtil.cpp index b3efa6b868..3c524ed9d8 100644 --- a/Source/Core/Common/FileUtil.cpp +++ b/Source/Core/Common/FileUtil.cpp @@ -46,6 +46,11 @@ #include <sys/param.h> #endif +#ifdef ANDROID +#include "Common/StringUtil.h" +#include "jni/AndroidCommon/AndroidCommon.h" +#endif + #ifndef S_ISDIR #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) #endif @@ -132,10 +137,19 @@ bool Delete(const std::string& filename) { INFO_LOG(COMMON, "Delete: file %s", filename.c_str()); +#ifdef ANDROID + if (StringBeginsWith(filename, "content://")) + { + const bool success = DeleteAndroidContent(filename); + if (!success) + WARN_LOG(COMMON, "Delete failed on %s", filename.c_str()); + return success; + } +#endif + const FileInfo file_info(filename); - // Return true because we care about the file no - // being there, not the actual delete. + // Return true because we care about the file not being there, not the actual delete. if (!file_info.Exists()) { WARN_LOG(COMMON, "Delete: %s does not exist", filename.c_str()); |
