3#include "../PackFile.h"
57 static constexpr std::array compressionTypeLUT = {
63 const auto idx = (
static_cast<std::uint8_t
>(
flags) & 7) - 1;
65 return compressionTypeLUT[idx];
141 static constexpr inline std::string_view
GUID =
"0C088488F666451E9361297528F2446D";
143 [[nodiscard]]
constexpr std::string_view
getGUID()
const override {
157 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
161 [[nodiscard]]
explicit operator std::string()
const override;
165 [[nodiscard]] uint32_t
getAppID()
const;
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr, const OpenPropertyRequest &requestProperty=nullptr)
std::vector< DirectoryMapEntry > dirmap_entries
std::vector< Block > blockdata
std::vector< ChecksumMapEntry > chksum_map
std::array< std::byte, 16 > decryption_key
uint32_t getVersion() const
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 ...
uint32_t getAppVersion() const
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
DataBlockHeader datablockheader
constexpr bool isCaseSensitive() const override
Does the format support case-sensitive file names?
constexpr bool hasEntryChecksums() const override
Returns true if the format has a checksum for each entry.
static constexpr std::string_view GUID
DirectoryHeader dirheader
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
std::vector< uint32_t > checksums
uint32_t getAppID() const
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
std::vector< uint32_t > fragmap
PackFileReadOnly(const std::string &fullFilePath_)
EntryCallbackBase< void > EntryCallback
std::function< std::vector< std::byte >(PackFile *packFile, OpenProperty property)> OpenPropertyRequest
constexpr std::string_view GCF_EXTENSION
uint32_t file_data_offset
@ COMPRESSED_AND_ENCRYPTED
uint32_t next_block_entry_index
CompressionType getCompressionType() const
uint32_t prev_block_entry_index
uint32_t first_data_block_index
DirectoryEntry entry_real