17 static std::unique_ptr<PackFile>
create(
const std::string& path);
20 [[nodiscard]]
static std::unique_ptr<PackFile>
open(
const std::string& path,
const EntryCallback& callback =
nullptr);
22 static constexpr std::string_view
GUID =
"F93DC196E4324EA4B035E6FF2645D8C5";
24 [[nodiscard]]
constexpr std::string_view
getGUID()
const override {
28 [[nodiscard]] std::optional<std::vector<std::byte>>
readEntry(
const std::string& path_)
const override;
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open an APK file.
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
void addEntryInternal(Entry &entry, const std::string &path, std::vector< std::byte > &buffer, EntryOptions options) override
static std::unique_ptr< PackFile > create(const std::string &path)
Create an APK file.
static constexpr std::string_view GUID
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
bool bake(const std::string &outputDir_, BakeOptions options, const EntryCallback &callback) override
If output folder is an empty string, it will overwrite the original.
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
PackFile(const PackFile &other)=delete
This class represents the metadata that a file has inside a PackFile.
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 APK_SIGNATURE
constexpr std::string_view APK_EXTENSION