5#include "../PackFile.h"
20 static std::unique_ptr<PackFile>
create(
const std::string& path,
bool forHROT =
false);
23 [[nodiscard]]
static std::unique_ptr<PackFile>
open(
const std::string& path,
const EntryCallback& callback =
nullptr);
25 static constexpr inline std::string_view
GUID =
"C282210FE64D46D1AE364D7E8E925542";
27 [[nodiscard]]
constexpr std::string_view
getGUID()
const override {
31 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
37 [[nodiscard]]
bool isHROT()
const;
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
This class represents the metadata that a file has inside a PackFile.
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a PAK file.
static std::unique_ptr< PackFile > create(const std::string &path, bool forHROT=false)
Create a PAK file.
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.
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
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
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 auto PAK_HROT_SIGNATURE
constexpr int8_t PAK_FILENAME_MAX_SIZE
constexpr auto PAK_SIGNATURE
constexpr int8_t PAK_HROT_FILENAME_MAX_SIZE
constexpr std::string_view PAK_EXTENSION