SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
REZ.h
Go to the documentation of this file.
1// ReSharper disable CppRedundantQualifier
2
3#pragma once
4
5#include "../PackFile.h"
6
7namespace vpkpp {
8
9constexpr std::string_view REZ_EXTENSION = ".rez";
10
11class REZ : public PackFileReadOnly {
12public:
14 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
15
16 [[nodiscard]] std::optional<std::vector<std::byte>> readEntry(const std::string& path_) const override;
17
18 [[nodiscard]] Attribute getSupportedEntryAttributes() const override;
19
20 [[nodiscard]] std::string_view getFileType() const;
21
22 [[nodiscard]] std::string_view getUserTitle() const;
23
24 [[nodiscard]] uint32_t getVersion() const;
25
26protected:
28
29 std::string fileType;
30 std::string userTitle;
31 uint32_t version;
32
33private:
34 VPKPP_REGISTER_PACKFILE_OPEN(REZ_EXTENSION, &REZ::open);
35};
36
37} // namespace vpkpp
PackFileReadOnly(const std::string &fullFilePath_)
Definition PackFile.cpp:755
EntryCallbackBase< void > EntryCallback
Definition PackFile.h:38
std::string userTitle
Definition REZ.h:30
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
Definition REZ.cpp:164
std::string_view getFileType() const
Definition REZ.cpp:169
uint32_t getVersion() const
Definition REZ.cpp:177
std::string_view getUserTitle() const
Definition REZ.cpp:173
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
Definition REZ.cpp:145
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a REZ file.
Definition REZ.cpp:10
std::string fileType
Definition REZ.h:29
PackFileReadOnly(const std::string &fullFilePath_)
Definition PackFile.cpp:755
uint32_t version
Definition REZ.h:31
Attribute
Definition Attribute.h:7
constexpr std::string_view REZ_EXTENSION
Definition REZ.h:9