SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
XZP.h
Go to the documentation of this file.
1#pragma once
2
4
5#include "../PackFile.h"
6
7namespace vpkpp {
8
11constexpr std::string_view XZP_EXTENSION = ".xzp";
12
13class XZP : public PackFileReadOnly {
14public:
16 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
17
18 static constexpr inline std::string_view GUID = "A682CF9BCA0A4980A920B5C00C8E0945";
19
20 [[nodiscard]] constexpr std::string_view getGUID() const override {
21 return XZP::GUID;
22 }
23
24 [[nodiscard]] std::optional<std::vector<std::byte>> readEntry(const std::string& path_) const override;
25
26 [[nodiscard]] Attribute getSupportedEntryAttributes() const override;
27
28protected:
30
31private:
33};
34
35} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition: PackFile.h:242
PackFileReadOnly(const std::string &fullFilePath_)
Definition: PackFile.cpp:720
EntryCallbackBase< void > EntryCallback
Definition: PackFile.h:30
Definition: XZP.h:13
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
Definition: XZP.cpp:155
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open an XZP file.
Definition: XZP.cpp:10
static constexpr std::string_view GUID
Definition: XZP.h:18
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
Definition: XZP.h:20
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
Definition: XZP.cpp:128
consteval uint32_t makeFourCC(const char fourCC[4])
Creates a FourCC identifier from a string of 4 characters.
Definition: Binary.h:18
Definition: Attribute.h:5
constexpr std::string_view XZP_EXTENSION
Definition: XZP.h:11
Attribute
Definition: Attribute.h:7
constexpr auto XZP_HEADER_SIGNATURE
Definition: XZP.h:9
constexpr auto XZP_FOOTER_SIGNATURE
Definition: XZP.h:10