5#include "../PackFile.h"
19 static std::unique_ptr<PackFile>
create(
const std::string& path);
22 [[nodiscard]]
static std::unique_ptr<PackFile>
open(
const std::string& path,
const EntryCallback& callback =
nullptr);
24 static constexpr inline std::string_view
GUID =
"1B4D626A278F47B9B2D4ADB244218B03";
26 [[nodiscard]]
constexpr std::string_view
getGUID()
const override {
30 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
This class represents the metadata that a file has inside a PackFile.
EntryCallbackBase< void > EntryCallback
PackFile(const PackFile &other)=delete
static constexpr std::string_view GUID
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a WAD3 file.
static std::unique_ptr< PackFile > create(const std::string &path)
Create a WAD3 file.
bool bake(const std::string &outputDir_, BakeOptions options, const EntryCallback &callback) override
If output folder is an empty string, it will overwrite the original.
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
void addEntryInternal(Entry &entry, const std::string &path, std::vector< std::byte > &buffer, EntryOptions options) override
consteval uint32_t makeFourCC(const char fourCC[4])
Creates a FourCC identifier from a string of 4 characters.
constexpr int8_t WAD3_FILENAME_MAX_SIZE
constexpr auto WAD3_SIGNATURE
constexpr std::string_view WAD3_EXTENSION