| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <optional> |
| 7 |
#include <string> |
| 8 |
|
| 9 |
#include "Common/CommonTypes.h" |
| 10 |
|
| 11 |
namespace Common |
| 12 |
{ |
| 13 |
enum class FromWhichRoot |
| 14 |
{ |
| 15 |
Configured, |
| 16 |
Session, |
| 17 |
Banners, |
| 18 |
}; |
| 19 |
|
| 20 |
std::string RootUserPath(FromWhichRoot from); |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
std::string GetImportTitlePath(u64 title_id, std::optional<FromWhichRoot> from = {}); |
| 28 |
|
| 29 |
std::string GetTicketFileName(u64 title_id, std::optional<FromWhichRoot> from = {}); |
| 30 |
std::string GetV1TicketFileName(u64 title_id, std::optional<FromWhichRoot> from = {}); |
| 31 |
std::string GetTitlePath(u64 title_id, std::optional<FromWhichRoot> from = {}); |
| 32 |
std::string GetTitleDataPath(u64 title_id, std::optional<FromWhichRoot> from = {}); |
| 33 |
std::string GetTitleContentPath(u64 title_id, std::optional<FromWhichRoot> from = {}); |
| 34 |
std::string GetTMDFileName(u64 title_id, std::optional<FromWhichRoot> from = {}); |
| 35 |
std::string GetMiiDatabasePath(std::optional<FromWhichRoot> from = {}); |
| 36 |
|
| 37 |
|
| 38 |
bool IsTitlePath(const std::string& path, std::optional<FromWhichRoot> from = {}, |
| 39 |
u64* title_id = nullptr); |
| 40 |
|
| 41 |
|
| 42 |
std::string EscapeFileName(const std::string& filename); |
| 43 |
|
| 44 |
std::string EscapePath(const std::string& path); |
| 45 |
|
| 46 |
std::string UnescapeFileName(const std::string& filename); |
| 47 |
|
| 48 |
bool IsFileNameSafe(const std::string_view filename); |
| 49 |
} |