3#include "../PackFile.h"
20 static std::unique_ptr<PackFile>
create(
const std::string& path);
23 [[nodiscard]]
static std::unique_ptr<PackFile>
open(
const std::string& path,
const EntryCallback& callback =
nullptr);
25 static constexpr inline std::string_view
GUID =
"3F3FDBC4F5D44B1F8A8E3AF5611B561B";
27 [[nodiscard]]
constexpr std::string_view
getGUID()
const override {
41 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
56 explicit ZIP(
const std::string& fullFilePath_);
62 bool openZIP(std::string_view path);
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
This class represents the metadata that a file has inside a PackFile.
EntryCallbackBase< void > EntryCallback
void addEntryInternal(Entry &entry, const std::string &path, std::vector< std::byte > &buffer, EntryOptions options) override
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
constexpr bool hasEntryChecksums() const override
Returns true if the format has a checksum for each entry.
const std::string tempZIPPath
void setEntryCompressionType(const std::string &path_, EntryCompressionType type)
void setEntryCompressionStrength(const std::string &path_, int16_t strength)
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a ZIP file.
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 ...
int16_t getEntryCompressionStrength(const std::string &path_) const
bool openZIP(std::string_view path)
bool bake(const std::string &outputDir_, BakeOptions options, const EntryCallback &callback) override
If output folder is an empty string, it will overwrite the original.
static constexpr std::string_view GUID
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
bool bakeTempZip(const std::string &writeZipPath, BakeOptions options, const EntryCallback &callback) const
constexpr bool isCaseSensitive() const override
Does the format support case-sensitive file names?
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
static std::unique_ptr< PackFile > create(const std::string &path)
Create a ZIP file.
EntryCompressionType getEntryCompressionType(const std::string &path_) const
constexpr std::string_view FPK_EXTENSION
constexpr std::string_view ZIP_EXTENSION
constexpr std::string_view PKZ_EXTENSION
constexpr std::string_view BEE_EXTENSION
constexpr std::string_view PK3_EXTENSION
constexpr std::string_view BMZ_EXTENSION
constexpr std::string_view PK4_EXTENSION