1
0
Fork 0
mirror of https://github.com/HamletDuFromage/aio-switch-updater.git synced 2024-11-09 12:01:44 +00:00
AIO-switch-updater/include/extract.hpp
PoloNX 64c13a5626
Update extract.cpp (#209)
* Update extract.cpp

Use Minizip beacause it's faster with big packs like deepsea

* fix for pull request

* fix crash at 66%

* fix create DIR

* Refactored extraction, possibly ironed out some bugs

* get uncompressed size using minizip

* use minizip to extract cheats, remove zipper dependency, fix getUncompressedSize()

Co-authored-by: flb <f.lb@gmx.com>
2022-08-07 15:39:17 +02:00

40 lines
No EOL
1.3 KiB
C++

#pragma once
#include <switch.h>
#include <functional>
#include <set>
#include <string>
#include <vector>
#include "constants.hpp"
namespace extract {
static constexpr u32 MaxTitleCount = 64000;
typedef struct Title
{
std::string id;
std::string name;
bool operator==(const Title& x) const
{
return id == x.id;
}
bool operator<(const Title& x) const
{
return id < x.id;
}
} Title;
void extract(
const std::string& filename, const std::string& workingPath = ROOT_PATH, int overwriteInis = 1, 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();
void removeOrphanedCheats();
bool removeCheatsDirectory(const std::string& entry);
bool isBID(const std::string& bid);
} // namespace extract