SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Toggle main menu visibility
Loading...
Searching...
No Matches
XZP.h
Go to the documentation of this file.
1
// ReSharper disable CppRedundantQualifier
2
3
#pragma once
4
5
#include <
sourcepp/parser/Binary.h
>
6
7
#include "
../PackFile.h
"
8
9
namespace
vpkpp
{
10
11
constexpr
auto
XZP_HEADER_SIGNATURE
=
sourcepp::parser::binary::makeFourCC
(
"piZx"
);
12
constexpr
auto
XZP_FOOTER_SIGNATURE
=
sourcepp::parser::binary::makeFourCC
(
"tFzX"
);
13
constexpr
std::string_view
XZP_EXTENSION
=
".xzp"
;
14
15
class
XZP
:
public
PackFileReadOnly
{
16
public
:
18
[[nodiscard]]
static
std::unique_ptr<PackFile>
open
(
const
std::string& path,
const
EntryCallback
& callback =
nullptr
);
19
20
[[nodiscard]] std::optional<std::vector<std::byte>>
readEntry
(
const
std::string& path_)
const override
;
21
22
[[nodiscard]]
Attribute
getSupportedEntryAttributes
()
const override
;
23
24
protected
:
25
using
PackFileReadOnly::PackFileReadOnly
;
26
27
private
:
28
VPKPP_REGISTER_PACKFILE_OPEN
(
XZP_EXTENSION
, &
XZP::open
);
29
};
30
31
}
// namespace vpkpp
Binary.h
PackFile.h
VPKPP_REGISTER_PACKFILE_OPEN
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition
PackFile.h:254
vpkpp::PackFileReadOnly::PackFileReadOnly
PackFileReadOnly(const std::string &fullFilePath_)
Definition
PackFile.cpp:755
vpkpp::PackFile::EntryCallback
EntryCallbackBase< void > EntryCallback
Definition
PackFile.h:38
vpkpp::XZP
Definition
XZP.h:15
vpkpp::XZP::getSupportedEntryAttributes
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
vpkpp::XZP::open
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open an XZP file.
Definition
XZP.cpp:10
vpkpp::XZP::readEntry
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
vpkpp::XZP::PackFileReadOnly
PackFileReadOnly(const std::string &fullFilePath_)
Definition
PackFile.cpp:755
sourcepp::parser::binary::makeFourCC
consteval uint32_t makeFourCC(const char fourCC[4])
Creates a FourCC identifier from a string of 4 characters.
Definition
Binary.h:20
vpkpp
Definition
Attribute.h:5
vpkpp::XZP_EXTENSION
constexpr std::string_view XZP_EXTENSION
Definition
XZP.h:13
vpkpp::Attribute
Attribute
Definition
Attribute.h:7
vpkpp::XZP_HEADER_SIGNATURE
constexpr auto XZP_HEADER_SIGNATURE
Definition
XZP.h:11
vpkpp::XZP_FOOTER_SIGNATURE
constexpr auto XZP_FOOTER_SIGNATURE
Definition
XZP.h:12
include
vpkpp
format
XZP.h
Generated on
for SourcePP by
1.17.0