Created
February 8, 2021 21:23
-
-
Save RChehowski/24e75ed8c09a76a26e7849374d6d8882 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by ASUS on 30/12/2020. | |
// | |
#include "Platform/Misc.h" | |
#include <optional> | |
#include <Allocation.h> | |
class CFileEntry | |
{ | |
public: | |
const std::string& GetFileName() const | |
{ | |
return FileName; | |
} | |
const Util::CAllocation& GetAllocation() const | |
{ | |
if (!OptionalAllocation.has_value()) | |
{ | |
// Lazy | |
// Read into OptionalAllocation from ZipFileHandle | |
} | |
return *OptionalAllocation; | |
} | |
private: | |
std::string FileName; | |
mutable std::optional<Util::CAllocation> OptionalAllocation; | |
void* ZipFileHandle = nullptr; | |
}; | |
class CZipFilesystem | |
{ | |
void Walk(const std::string& PathToArchive, std::function<void(const CFileEntry&)> Consumer) | |
{ | |
// Open PathToArchive | |
// For each Entry -> Consumer(Entry) | |
// Close archive | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment