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// ReSharper disable CppRedundantQualifier
2
3#pragma once
4
5#include "../PackFile.h"
6
7namespace vpkpp {
8
9constexpr std::string_view ORE_EXTENSION = ".ore";
10
11class ORE : public PackFileReadOnly {
12public:
14 static std::unique_ptr<PackFile> create(const std::string& path);
15
17 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
18
19 static constexpr std::string_view GUID = "E7E541C05CFE4934B1CDA931EF2E1D99";
20
21 [[nodiscard]] constexpr std::string_view getGUID() const override {
22 return ORE::GUID;
23 }
24
25 [[nodiscard]] std::optional<std::vector<std::byte>> readEntry(const std::string& path_) const override;
26
27 [[nodiscard]] Attribute getSupportedEntryAttributes() const override;
28
29protected:
31
32private:
34};
35
36} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition PackFile.h:255
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:19
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
Definition ORE.h:21
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:728
PackFileReadOnly(const std::string &fullFilePath_)
Definition PackFile.cpp:728
EntryCallbackBase< void > EntryCallback
Definition PackFile.h:38
constexpr std::string_view ORE_EXTENSION
Definition ORE.h:9
Attribute
Definition Attribute.h:7