2020-09-20 02:21:28 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <switch.h>
|
2021-09-11 15:48:13 +02:00
|
|
|
|
2021-10-21 23:12:29 +02:00
|
|
|
#include <functional>
|
2020-09-20 02:21:28 +02:00
|
|
|
#include <set>
|
2021-02-10 17:28:47 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2020-09-20 02:21:28 +02:00
|
|
|
|
2021-09-11 15:48:13 +02:00
|
|
|
#include "constants.hpp"
|
2020-09-20 02:21:28 +02:00
|
|
|
|
2021-09-11 15:48:13 +02:00
|
|
|
namespace extract {
|
2021-03-16 03:04:21 +01:00
|
|
|
static constexpr u32 MaxTitleCount = 64000;
|
2021-09-11 15:48:13 +02:00
|
|
|
typedef struct Title
|
|
|
|
{
|
2021-03-16 03:04:21 +01:00
|
|
|
std::string id;
|
|
|
|
std::string name;
|
2021-09-11 15:48:13 +02:00
|
|
|
bool operator==(const Title& x) const
|
|
|
|
{
|
2021-03-16 03:04:21 +01:00
|
|
|
return id == x.id;
|
|
|
|
}
|
2020-09-20 02:21:28 +02:00
|
|
|
|
2021-09-11 15:48:13 +02:00
|
|
|
bool operator<(const Title& x) const
|
|
|
|
{
|
2021-03-16 03:04:21 +01:00
|
|
|
return id < x.id;
|
|
|
|
}
|
|
|
|
} Title;
|
|
|
|
|
2021-10-21 23:12:29 +02:00
|
|
|
void extract(
|
|
|
|
const std::string& filename, const std::string& workingPath = ROOT_PATH, int overwriteInis = 1, std::function<void()> func = []() { return; });
|
2021-03-16 03:04:21 +01:00
|
|
|
std::vector<std::string> getInstalledTitlesNs();
|
2021-06-28 00:46:00 +02:00
|
|
|
std::vector<std::string> excludeTitles(const std::string& path, const std::vector<std::string>& listedTitles);
|
2021-06-28 16:58:04 +02:00
|
|
|
void writeTitlesToFile(const std::set<std::string>& titles, const std::string& path);
|
2021-11-19 14:28:10 +01:00
|
|
|
void extractCheats(const std::string& zipPath, const std::vector<std::string>& titles, CFW cfw, const std::string& version, bool extractAll = false);
|
|
|
|
void extractAllCheats(const std::string& zipPath, CFW cfw, const std::string& version);
|
2021-07-15 19:56:59 +02:00
|
|
|
void removeCheats();
|
2021-10-14 21:50:18 +02:00
|
|
|
void removeOrphanedCheats();
|
2021-09-21 15:07:47 +02:00
|
|
|
bool removeCheatsDirectory(const std::string& entry);
|
2021-07-17 14:29:55 +02:00
|
|
|
bool isBID(const std::string& bid);
|
2021-09-11 15:48:13 +02:00
|
|
|
} // namespace extract
|