summaryrefslogtreecommitdiff
path: root/Source/Android/jni/AndroidCommon/AndroidCommon.h
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2020-12-30 11:10:35 +0100
committerGitHub <noreply@github.com>2020-12-30 11:10:35 +0100
commitc1d041b8886e60400721b827dcf2eb7cce45eceb (patch)
tree97cb04428e3338c03e9a82db27fc411e2c2243de /Source/Android/jni/AndroidCommon/AndroidCommon.h
parent8a3b14d7dca147232a87b51cef12840656292171 (diff)
parentd78277c063d43e3234fe80a38d272500f3dfce3a (diff)
Merge pull request #9318 from JosJuice/android-saf-games
Android: Use storage access framework for game list
Diffstat (limited to 'Source/Android/jni/AndroidCommon/AndroidCommon.h')
-rw-r--r--Source/Android/jni/AndroidCommon/AndroidCommon.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Android/jni/AndroidCommon/AndroidCommon.h b/Source/Android/jni/AndroidCommon/AndroidCommon.h
index 7ff745f047..7d4f5d0fbc 100644
--- a/Source/Android/jni/AndroidCommon/AndroidCommon.h
+++ b/Source/Android/jni/AndroidCommon/AndroidCommon.h
@@ -4,7 +4,9 @@
#pragma once
+#include <ios>
#include <string>
+#include <vector>
#include <jni.h>
@@ -17,12 +19,29 @@ bool IsPathAndroidContent(const std::string& uri);
// Turns a C/C++ style mode (e.g. "rb") into one which can be used with OpenAndroidContent.
std::string OpenModeToAndroid(std::string mode);
+std::string OpenModeToAndroid(std::ios_base::openmode mode);
// Opens a given file and returns a file descriptor.
int OpenAndroidContent(const std::string& uri, const std::string& mode);
// Deletes a given file.
bool DeleteAndroidContent(const std::string& uri);
+// Returns -1 if not found, -2 if directory, file size otherwise.
+jlong GetAndroidContentSizeAndIsDirectory(const std::string& uri);
+
+// An unmangled URI (one which the C++ code has not appended anything to) can't be relied on
+// to contain a file name at all. If a file name is desired, this function is the most reliable
+// way to get it, but the display name is not guaranteed to always actually be like a file name.
+// An empty string will be returned for files which do not exist.
+std::string GetAndroidContentDisplayName(const std::string& uri);
+
+// Returns the display names of all children of a directory, non-recursively.
+std::vector<std::string> GetAndroidContentChildNames(const std::string& uri);
+
+std::vector<std::string> DoFileSearchAndroidContent(const std::string& directory,
+ const std::vector<std::string>& extensions,
+ bool recursive);
+
int GetNetworkIpAddress();
int GetNetworkPrefixLength();
int GetNetworkGateway();