summaryrefslogtreecommitdiffstats
path: root/src/common/string_util.cpp
diff options
context:
space:
mode:
authorCharles Lombardo <clombardo169@gmail.com>2023-10-25 04:51:09 +0200
committerCharles Lombardo <clombardo169@gmail.com>2023-10-30 16:38:10 +0100
commit585b6e9d46b207a6b48a021ea35636fb8c92b405 (patch)
tree8909909ba82a90979748d6fa2bd875aa47cea050 /src/common/string_util.cpp
parentandroid: Refactor game metadata collection to new file (diff)
downloadyuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar
yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.gz
yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.bz2
yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.lz
yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.xz
yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.tar.zst
yuzu-585b6e9d46b207a6b48a021ea35636fb8c92b405.zip
Diffstat (limited to 'src/common/string_util.cpp')
-rw-r--r--src/common/string_util.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index 4c7aba3f5..72c481798 100644
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -14,6 +14,10 @@
#include <windows.h>
#endif
+#ifdef ANDROID
+#include <common/fs/fs_android.h>
+#endif
+
namespace Common {
/// Make a string lowercase
@@ -63,6 +67,14 @@ bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _
if (full_path.empty())
return false;
+#ifdef ANDROID
+ if (full_path[0] != '/') {
+ *_pPath = Common::FS::Android::GetParentDirectory(full_path);
+ *_pFilename = Common::FS::Android::GetFilename(full_path);
+ return true;
+ }
+#endif
+
std::size_t dir_end = full_path.find_last_of("/"
// windows needs the : included for something like just "C:" to be considered a directory
#ifdef _WIN32