2022-04-12 20:15:30 -04:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2022-06-22 23:37:46 -04:00
|
|
|
|
2022-07-05 20:38:13 -04:00
|
|
|
#include "common/util/FileUtil.h"
|
|
|
|
|
2022-04-12 20:15:30 -04:00
|
|
|
struct IsoFile {
|
|
|
|
struct Entry {
|
|
|
|
bool is_dir = false;
|
|
|
|
std::string name;
|
|
|
|
|
|
|
|
// if file
|
|
|
|
size_t offset_in_file = 0;
|
|
|
|
size_t size = 0;
|
|
|
|
|
|
|
|
// if dir
|
|
|
|
std::vector<Entry> children;
|
|
|
|
void print(std::string* result, const std::string& prefix) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::string print() const;
|
|
|
|
|
|
|
|
Entry root;
|
|
|
|
|
2022-04-18 18:33:55 -04:00
|
|
|
int files_extracted = 0;
|
|
|
|
bool shouldHash = false;
|
|
|
|
// There is no reason to map to the files, as we don't retain mappings of each file's expected
|
|
|
|
// hash
|
2022-12-22 17:12:05 -05:00
|
|
|
std::vector<uint64_t> hashes = {};
|
2022-04-18 18:33:55 -04:00
|
|
|
|
2022-04-12 20:15:30 -04:00
|
|
|
IsoFile();
|
|
|
|
};
|
|
|
|
|
|
|
|
IsoFile find_files_in_iso(FILE* fp);
|
2022-07-05 20:38:13 -04:00
|
|
|
void unpack_iso_files(FILE* fp, IsoFile& layout, const fs::path& dest);
|
2022-06-22 00:16:34 -04:00
|
|
|
IsoFile unpack_iso_files(FILE* fp,
|
2022-07-05 20:38:13 -04:00
|
|
|
const fs::path& dest,
|
2022-06-22 00:16:34 -04:00
|
|
|
bool print_progress,
|
|
|
|
const bool hashFiles = false);
|