2020-09-20 01:21:28 +01:00
|
|
|
#pragma once
|
|
|
|
|
2021-02-10 16:28:47 +00:00
|
|
|
#include "constants.hpp"
|
2020-09-20 01:21:28 +01:00
|
|
|
#include <switch.h>
|
|
|
|
#include <set>
|
2021-02-10 16:28:47 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2020-09-20 01:21:28 +01:00
|
|
|
|
2021-03-16 02:04:21 +00:00
|
|
|
namespace extract {
|
2020-09-20 01:21:28 +01:00
|
|
|
|
2021-03-16 02:04:21 +00:00
|
|
|
static constexpr u32 MaxTitleCount = 64000;
|
2020-09-20 01:21:28 +01:00
|
|
|
|
2021-03-16 02:04:21 +00:00
|
|
|
typedef struct Title {
|
|
|
|
std::string id;
|
|
|
|
std::string name;
|
|
|
|
bool operator ==(const Title&x) const {
|
|
|
|
return id == x.id;
|
|
|
|
}
|
2020-09-20 01:21:28 +01:00
|
|
|
|
2021-03-16 02:04:21 +00:00
|
|
|
bool operator <(const Title&x) const {
|
|
|
|
return id < x.id;
|
|
|
|
}
|
|
|
|
} Title;
|
|
|
|
|
2021-05-22 17:10:34 +01:00
|
|
|
void extract(const std::string& filename, const std::string& workingPath = ROOT_PATH, int overwriteInis = 1);
|
|
|
|
void extract(const std::string& filename, const std::string& workingPath, const std::string& toExclude);
|
2021-03-16 02:04:21 +00:00
|
|
|
std::vector<std::string> getInstalledTitlesNs();
|
2021-05-22 17:10:34 +01:00
|
|
|
std::vector<std::string> excludeTitles(const std::string& path, std::vector<std::string> listedTitles);
|
|
|
|
void writeTitlesToFile(std::set<std::string> titles, const std::string& path);
|
|
|
|
void extractCheats(const std::string& zipPath, std::vector<std::string> titles, CFW cfw, bool credits = false);
|
|
|
|
void extractAllCheats(const std::string& zipPath, CFW cfw);
|
2021-03-16 02:04:21 +00:00
|
|
|
void removeCheats(CFW cfw);
|
|
|
|
bool isBID(std::string bid);
|
|
|
|
|
|
|
|
}
|