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/UWP/UWPHelpers/StorageManager.h
Views: 1401
1
// Copyright (c) 2023- PPSSPP Project.
2
3
// This program is free software: you can redistribute it and/or modify
4
// it under the terms of the GNU General Public License as published by
5
// the Free Software Foundation, version 2.0 or later versions.
6
7
// This program is distributed in the hope that it will be useful,
8
// but WITHOUT ANY WARRANTY; without even the implied warranty of
9
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
// GNU General Public License 2.0 for more details.
11
12
// A copy of the GPL 2.0 should have been included with the program.
13
// If not, see http://www.gnu.org/licenses/
14
15
// Official git repository and contact information can be found at
16
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
17
18
#pragma once
19
20
#include <list>
21
#include <set>
22
#include <string>
23
24
#include "Common/File/DirListing.h"
25
#include "StoragePickers.h"
26
27
// Locations
28
std::string GetPSPFolder(); // Where main data is, default is app data
29
std::string GetInstallationFolder();
30
std::string GetLocalFolder();
31
std::string GetTempFolder();
32
std::string GetTempFile(std::string name);
33
std::string GetPicturesFolder(); // Requires 'picturesLibrary' capability
34
std::string GetVideosFolder(); // Requires 'videosLibrary' capability
35
std::string GetDocumentsFolder(); // Requires 'documentsLibrary' capability
36
std::string GetMusicFolder(); // Requires 'musicLibrary' capability
37
std::string GetPreviewPath(std::string path);
38
bool isLocalState(std::string path);
39
40
// Management
41
// `GetFileStreamFromApp` Will use Windows UWP API, use it instead of fopen..etc
42
FILE* GetFileStreamFromApp(std::string path, const char* mode);
43
44
// 'driveName' like C:
45
bool CheckDriveAccess(std::string driveName);
46
bool GetFakeFolders(Path path, std::vector<File::FileInfo>* files, const char* filter, std::set<std::string> filters);
47
bool IsRootForAccessibleItems(std::string path);
48
49
// Helpers
50
bool OpenFile(std::string path);
51
bool OpenFolder(std::string path);
52
std::string ResolvePathUWP(std::string path);
53
bool GetDriveFreeSpace(Path path, int64_t& space);
54
55
// Log helpers
56
std::string GetLogFile();
57
58