SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
ORE.h
Go to the documentation of this file.
1#pragma once
2
3#include "../PackFile.h"
4
5namespace vpkpp {
6
7constexpr std::string_view ORE_EXTENSION = ".ore";
8
9class ORE : public PackFileReadOnly {
10public:
12 static std::unique_ptr<PackFile> create(const std::string& path);
13
15 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
16
17 static constexpr inline std::string_view GUID = "E7E541C05CFE4934B1CDA931EF2E1D99";
18
19 [[nodiscard]] constexpr std::string_view getGUID() const override {
20 return ORE::GUID;
21 }
22
23 [[nodiscard]] std::optional<std::vector<std::byte>> readEntry(const std::string& path_) const override;
24
25 [[nodiscard]] Attribute getSupportedEntryAttributes() const override;
26
27protected:
29
30private:
32};
33
34} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition: PackFile.h:242
Definition: ORE.h:9
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
Definition: ORE.cpp:76
static std::unique_ptr< PackFile > create(const std::string &path)
Create an ORE file.
Definition: ORE.cpp:10
static constexpr std::string_view GUID
Definition: ORE.h:17
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
Definition: ORE.h:19
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
Definition: ORE.cpp:95
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open an ORE file.
Definition: ORE.cpp:21
PackFileReadOnly(const std::string &fullFilePath_)
Definition: PackFile.cpp:720
EntryCallbackBase< void > EntryCallback
Definition: PackFile.h:30
Definition: Attribute.h:5
constexpr std::string_view ORE_EXTENSION
Definition: ORE.h:7
Attribute
Definition: Attribute.h:7