2023-01-22 17:32:34 +00:00
|
|
|
//
|
2023-01-31 10:36:14 +00:00
|
|
|
// DarwinFileSystemServices.h
|
2023-01-22 17:32:34 +00:00
|
|
|
// PPSSPP
|
|
|
|
//
|
|
|
|
// Created by Serena on 20/01/2023.
|
|
|
|
//
|
|
|
|
|
2023-02-01 16:03:12 +00:00
|
|
|
#pragma once
|
2023-01-22 17:32:34 +00:00
|
|
|
|
|
|
|
#include "ppsspp_config.h"
|
|
|
|
#include "Common/File/Path.h"
|
2023-07-16 13:22:04 +00:00
|
|
|
#include "Common/System/Request.h"
|
2023-01-22 17:32:34 +00:00
|
|
|
|
|
|
|
#define PreferredMemoryStickUserDefaultsKey "UserPreferredMemoryStickDirectoryPath"
|
|
|
|
|
2023-03-22 15:20:30 +00:00
|
|
|
typedef std::function<void (bool, Path)> DarwinDirectoryPanelCallback;
|
2023-01-22 17:32:34 +00:00
|
|
|
|
2023-01-31 10:36:14 +00:00
|
|
|
/// A Class providing help functions to work with the FileSystem
|
|
|
|
/// on Darwin platforms.
|
|
|
|
class DarwinFileSystemServices {
|
2023-01-22 17:32:34 +00:00
|
|
|
public:
|
2023-07-16 13:22:04 +00:00
|
|
|
/// Present a panel to choose a file or directory.
|
|
|
|
void presentDirectoryPanel(
|
|
|
|
DarwinDirectoryPanelCallback,
|
|
|
|
bool allowFiles = false,
|
|
|
|
bool allowDirectories = true,
|
|
|
|
BrowseFileType fileType = BrowseFileType::ANY);
|
|
|
|
|
|
|
|
static Path appropriateMemoryStickDirectoryToUse();
|
|
|
|
static void setUserPreferredMemoryStickDirectory(Path);
|
2023-01-22 17:32:34 +00:00
|
|
|
private:
|
2023-07-16 13:22:04 +00:00
|
|
|
static Path __defaultMemoryStickPath();
|
2023-01-22 17:32:34 +00:00
|
|
|
#if PPSSPP_PLATFORM(IOS)
|
2023-07-16 13:22:04 +00:00
|
|
|
// iOS only, needed for UIDocumentPickerViewController
|
|
|
|
void *__pickerDelegate = NULL;
|
2023-01-22 17:32:34 +00:00
|
|
|
#endif // PPSSPP_PLATFORM(IOS)
|
|
|
|
};
|
2023-02-06 19:17:27 +00:00
|
|
|
|
2023-04-29 09:17:10 +00:00
|
|
|
void RestartMacApp();
|