5#include "../PackFile.h"
28 [[nodiscard]]
static std::unique_ptr<PackFile>
open(
const std::string& path,
const EntryCallback& callback =
nullptr);
30 static constexpr inline std::string_view
GUID =
"49191CA83B7B4EBBA86D0EA364AAC457";
32 [[nodiscard]]
constexpr std::string_view
getGUID()
const override {
46 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
52 [[nodiscard]]
explicit operator std::string()
const override;
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
This class represents the metadata that a file has inside a PackFile.
void addEntryInternal(Entry &entry, const std::string &path, std::vector< std::byte > &buffer, EntryOptions options) override
bool verifyPackFileChecksum() const override
Verify the checksum of the entire file, returns true on success Will return true if there is no check...
bool bake(const std::string &outputDir_, BakeOptions options, const EntryCallback &callback) override
If output folder is an empty string, it will overwrite the original.
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a GMA file.
constexpr bool hasEntryChecksums() const override
Returns true if the format has a checksum for each entry.
std::vector< std::string > verifyEntryChecksums() const override
Verify the checksums of each file, if a file fails the check its path will be added to the vector If ...
bool hasPackFileChecksum() const override
Returns true if the entire file has a checksum.
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
static constexpr std::string_view GUID
EntryCallbackBase< void > EntryCallback
PackFile(const PackFile &other)=delete
consteval uint32_t makeFourCC(const char fourCC[4])
Creates a FourCC identifier from a string of 4 characters.
constexpr std::string_view GMA_EXTENSION
constexpr auto GMA_SIGNATURE