CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/UI/DarwinFileSystemServices.h
Views: 1401
1
//
2
// DarwinFileSystemServices.h
3
// PPSSPP
4
//
5
// Created by Serena on 20/01/2023.
6
//
7
8
#pragma once
9
10
#include "ppsspp_config.h"
11
#include "Common/File/Path.h"
12
#include "Common/System/Request.h"
13
14
#define PreferredMemoryStickUserDefaultsKey "UserPreferredMemoryStickDirectoryPath"
15
16
typedef std::function<void (bool, Path)> DarwinDirectoryPanelCallback;
17
18
/// A Class providing help functions to work with the FileSystem
19
/// on Darwin platforms.
20
class DarwinFileSystemServices {
21
public:
22
/// Present a panel to choose a file or directory.
23
static void presentDirectoryPanel(
24
DarwinDirectoryPanelCallback panelCallback,
25
bool allowFiles = false,
26
bool allowDirectories = true,
27
BrowseFileType fileType = BrowseFileType::ANY);
28
29
static Path appropriateMemoryStickDirectoryToUse();
30
static void setUserPreferredMemoryStickDirectory(Path);
31
static Path defaultMemoryStickPath();
32
33
static void ClearDelegate();
34
private:
35
#if PPSSPP_PLATFORM(IOS)
36
// iOS only, needed for UIDocumentPickerViewController
37
static void *__pickerDelegate;
38
#endif // PPSSPP_PLATFORM(IOS)
39
};
40
41
void RestartMacApp();
42
43