SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
OO7.h
Go to the documentation of this file.
1// ReSharper disable CppRedundantQualifier
2
3#pragma once
4
5#include <array>
6
7#include "../PackFile.h"
8
9namespace vpkpp {
10
11constexpr std::string_view OO7_EXTENSION = ".007";
12
13class OO7 : public PackFileReadOnly {
14public:
16 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
17
18 [[nodiscard]] bool hasPackFileChecksum() const override;
19
20 [[nodiscard]] bool verifyPackFileChecksum() const override;
21
22 [[nodiscard]] constexpr bool isCaseSensitive() const override {
23 return true;
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
30 [[nodiscard]] explicit operator std::string() const override;
31
32protected:
34
35 uint32_t majorVersion{};
36 uint32_t minorVersion{};
37 bool hasChecksum = false;
38 std::array<std::byte, 16> checksum{};
39
40private:
42};
43
44} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition PackFile.h:245
uint32_t minorVersion
Definition OO7.h:36
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
Definition OO7.cpp:159
uint32_t majorVersion
Definition OO7.h:35
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a 007 file.
Definition OO7.cpp:12
constexpr bool isCaseSensitive() const override
Does the format support case-sensitive file names?
Definition OO7.h:22
bool hasChecksum
Definition OO7.h:37
bool verifyPackFileChecksum() const override
Verify the checksum of the entire file, returns true on success Will return true if there is no check...
Definition OO7.cpp:110
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
Definition OO7.cpp:129
bool hasPackFileChecksum() const override
Returns true if the entire file has a checksum.
Definition OO7.cpp:106
std::array< std::byte, 16 > checksum
Definition OO7.h:38
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
Attribute
Definition Attribute.h:7
constexpr std::string_view OO7_EXTENSION
Definition OO7.h:11