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 std::string_view
GUID =
"BF4352054D444027AD27A8DF69178A82";
27 [[nodiscard]]
constexpr std::string_view
getGUID()
const override {
31 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
33 bool renameEntry(
const std::string& oldPath,
const std::string& newPath)
override;
35 bool renameDirectory(
const std::string& oldDir,
const std::string& newDir)
override;
45 [[nodiscard]]
explicit operator std::string()
const override;
51 [[nodiscard]]
static uint32_t
hashFilePath(
const std::string& filepath);
#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
void setLoadingScreenFilePath(const std::string &path)
static std::unique_ptr< PackFile > create(const std::string &path)
Create an FGP file.
std::string loadingScreenPath
bool renameEntry(const std::string &oldPath, const std::string &newPath) override
Rename an existing entry.
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
bool renameDirectory(const std::string &oldDir, const std::string &newDir) override
Rename an existing directory.
std::size_t removeDirectory(const std::string &dirName) override
Remove a directory.
static constexpr std::string_view GUID
std::string getLoadingScreenFilePath() const
static uint32_t hashFilePath(const std::string &filepath)
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
PackFile(const PackFile &other)=delete
bool removeEntry(const std::string &path) override
Remove an entry.
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open an FGP file.
static uint32_t getHeaderSize(uint32_t version, uint32_t fileCount)
bool bake(const std::string &outputDir_, BakeOptions options, const EntryCallback &callback) override
If output folder is an empty string, it will overwrite the original.
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.
consteval uint64_t makeEightCC(const char eightCC[8])
Creates a EightCC identifier from a string of 8 characters.
constexpr std::string_view FGP_HASHED_FILEPATH_PREFIX
constexpr std::string_view FGP_EXTENSION
constexpr auto FGP_SOURCEPP_FILENAMES_SIGNATURE
constexpr auto FGP_SIGNATURE