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// ReSharper disable CppRedundantQualifier
2
3#pragma once
4
6
7#include "../PackFile.h"
8
9namespace vpkpp {
10
13constexpr std::string_view XZP_EXTENSION = ".xzp";
14
15class XZP : public PackFileReadOnly {
16public:
18 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
19
20 static constexpr std::string_view GUID = "A682CF9BCA0A4980A920B5C00C8E0945";
21
22 [[nodiscard]] constexpr std::string_view getGUID() const override {
23 return XZP::GUID;
24 }
25
26 [[nodiscard]] std::optional<std::vector<std::byte>> readEntry(const std::string& path_) const override;
27
28 [[nodiscard]] Attribute getSupportedEntryAttributes() const override;
29
30protected:
32
33private:
35};
36
37} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition PackFile.h:255
PackFileReadOnly(const std::string &fullFilePath_)
Definition PackFile.cpp:728
EntryCallbackBase< void > EntryCallback
Definition PackFile.h:38
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:20
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
Definition XZP.h:22
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
PackFileReadOnly(const std::string &fullFilePath_)
Definition PackFile.cpp:728
consteval uint32_t makeFourCC(const char fourCC[4])
Creates a FourCC identifier from a string of 4 characters.
Definition Binary.h:20
constexpr std::string_view XZP_EXTENSION
Definition XZP.h:13
Attribute
Definition Attribute.h:7
constexpr auto XZP_HEADER_SIGNATURE
Definition XZP.h:11
constexpr auto XZP_FOOTER_SIGNATURE
Definition XZP.h:12