1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-25 02:52:05 +00:00
AIO-switch-updater/include/extract.hpp

40 lines
1.3 KiB
C++
Raw Normal View History

2020-09-20 01:21:28 +01:00
#pragma once
#include <switch.h>
2021-09-11 14:48:13 +01:00
#include <functional>
2020-09-20 01:21:28 +01:00
#include <set>
2021-02-10 16:28:47 +00:00
#include <string>
#include <vector>
2020-09-20 01:21:28 +01:00
2021-09-11 14:48:13 +01:00
#include "constants.hpp"
2020-09-20 01:21:28 +01:00
2021-09-11 14:48:13 +01:00
namespace extract {
static constexpr u32 MaxTitleCount = 64000;
2021-09-11 14:48:13 +01:00
typedef struct Title
{
std::string id;
std::string name;
2021-09-11 14:48:13 +01:00
bool operator==(const Title& x) const
{
return id == x.id;
}
2020-09-20 01:21:28 +01:00
2021-09-11 14:48:13 +01:00
bool operator<(const Title& x) const
{
return id < x.id;
}
} Title;
void extract(
2022-11-04 01:24:45 +00:00
const std::string& filename, const std::string& workingPath = ROOT_PATH, bool preserveInis = false, std::function<void()> func = []() { return; });
std::vector<std::string> getInstalledTitlesNs();
std::vector<std::string> excludeTitles(const std::string& path, const std::vector<std::string>& listedTitles);
void writeTitlesToFile(const std::set<std::string>& titles, const std::string& path);
void extractCheats(const std::string& archivePath, const std::vector<std::string>& titles, CFW cfw, const std::string& version, bool extractAll = false);
void extractAllCheats(const std::string& archivePath, CFW cfw, const std::string& version);
void removeCheats();
2021-10-14 20:50:18 +01:00
void removeOrphanedCheats();
bool removeCheatsDirectory(const std::string& entry);
bool isBID(const std::string& bid);
2021-09-11 14:48:13 +01:00
} // namespace extract