32 [[nodiscard]]
static std::unique_ptr<PackFile>
open(
const std::string& path,
const EntryCallback& callback =
nullptr);
34 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
40 [[nodiscard]]
explicit operator std::string()
const override;
50 [[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.
EntryCallbackBase< void > EntryCallback
bool bake()
If output folder is an empty string, it will overwrite the original.
PackFile(const PackFile &other)=delete
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a TAB file.
void setVersion(Version version_)
uint32_t getSectorSize() const
void addEntryInternal(Entry &entry, const std::string &path, std::vector< std::byte > &buffer, EntryOptions options) override
void setSectorSize(uint32_t sectorSize_)
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
static uint32_t hashFilePath(const std::string &filepath)
PackFile(const PackFile &other)=delete
Version getVersion() const
static std::unique_ptr< PackFile > create(const std::string &path, Version version=Version::JC1_LE, uint32_t sectorSize=2048)
Create a TAB file.
constexpr std::string_view ARC_EXTENSION
constexpr uint32_t ARC_CHUNK_SIZE
Chunk size in bytes (1gb).
constexpr auto TAB_FILENAME_MAX_SIZE
constexpr std::string_view TAB_EXTENSION
constexpr std::string_view TAB_HASHED_FILEPATH_PREFIX