2023-02-04 00:13:16 +00:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
#include <jni.h>
|
|
|
|
|
|
|
|
namespace Common::FS::Android {
|
|
|
|
|
|
|
|
static JavaVM* g_jvm = nullptr;
|
|
|
|
static jclass native_library = nullptr;
|
|
|
|
|
2024-02-05 11:10:45 +00:00
|
|
|
static jmethodID s_get_parent_directory;
|
|
|
|
static jmethodID s_get_filename;
|
|
|
|
static jmethodID s_get_size;
|
|
|
|
static jmethodID s_is_directory;
|
|
|
|
static jmethodID s_file_exists;
|
|
|
|
static jmethodID s_open_content_uri;
|
2023-02-04 00:13:16 +00:00
|
|
|
|
|
|
|
enum class OpenMode {
|
|
|
|
Read,
|
|
|
|
Write,
|
|
|
|
ReadWrite,
|
|
|
|
WriteAppend,
|
|
|
|
WriteTruncate,
|
|
|
|
ReadWriteAppend,
|
|
|
|
ReadWriteTruncate,
|
|
|
|
Never
|
|
|
|
};
|
|
|
|
|
|
|
|
void RegisterCallbacks(JNIEnv* env, jclass clazz);
|
|
|
|
|
|
|
|
void UnRegisterCallbacks();
|
|
|
|
|
|
|
|
bool IsContentUri(const std::string& path);
|
|
|
|
|
2024-02-05 11:10:45 +00:00
|
|
|
int OpenContentUri(const std::string& filepath, OpenMode openmode);
|
|
|
|
std::uint64_t GetSize(const std::string& filepath);
|
|
|
|
bool IsDirectory(const std::string& filepath);
|
|
|
|
bool Exists(const std::string& filepath);
|
|
|
|
std::string GetParentDirectory(const std::string& filepath);
|
|
|
|
std::string GetFilename(const std::string& filepath);
|
2023-10-25 02:51:09 +00:00
|
|
|
|
2023-02-04 00:13:16 +00:00
|
|
|
} // namespace Common::FS::Android
|