SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
VPK_VTMB.h
Go to the documentation of this file.
1
// ReSharper disable CppRedundantQualifier
2
3
#pragma once
4
5
#include "
../PackFile.h
"
6
7
namespace
vpkpp
{
8
9
constexpr
std::string_view
VPK_VTMB_EXTENSION
=
".vpk"
;
10
11
class
VPK_VTMB
:
public
PackFile
{
12
public
:
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
[[nodiscard]] std::optional<std::vector<std::byte>>
readEntry
(
const
std::string& path_)
const override
;
20
21
bool
bake
(
const
std::string& outputDir_
/*= ""*/
,
BakeOptions
options
/*= {}*/
,
const
EntryCallback
& callback
/*= nullptr*/
)
override
;
22
23
[[nodiscard]] std::string
getTruncatedFilestem
()
const override
;
24
25
[[nodiscard]]
Attribute
getSupportedEntryAttributes
()
const override
;
26
27
protected
:
28
using
PackFile::PackFile
;
29
30
void
openNumbered
(uint32_t archiveIndex,
const
std::string& path,
const
EntryCallback
& callback);
31
32
void
addEntryInternal
(
Entry
& entry,
const
std::string& path, std::vector<std::byte>& buffer,
EntryOptions
options)
override
;
33
34
std::vector<uint32_t>
knownArchives
;
35
uint32_t
currentArchive
= 0;
36
37
private
:
38
VPKPP_REGISTER_PACKFILE_OPEN
(
VPK_VTMB_EXTENSION
, &
VPK_VTMB::open
);
39
};
40
41
}
// namespace vpkpp
PackFile.h
VPKPP_REGISTER_PACKFILE_OPEN
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition
PackFile.h:254
vpkpp::Entry
This class represents the metadata that a file has inside a PackFile.
Definition
Entry.h:14
vpkpp::PackFile::EntryCallback
EntryCallbackBase< void > EntryCallback
Definition
PackFile.h:38
vpkpp::PackFile::bake
bool bake()
If output folder is an empty string, it will overwrite the original.
Definition
PackFile.cpp:369
vpkpp::PackFile::PackFile
PackFile(const PackFile &other)=delete
vpkpp::VPK_VTMB
Definition
VPK_VTMB.h:11
vpkpp::VPK_VTMB::open
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open Vampire: The Masquerade - Bloodlines VPK files.
Definition
VPK_VTMB.cpp:25
vpkpp::VPK_VTMB::create
static std::unique_ptr< PackFile > create(const std::string &path)
Create Vampire: The Masquerade - Bloodlines VPK files.
Definition
VPK_VTMB.cpp:14
vpkpp::VPK_VTMB::getSupportedEntryAttributes
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
Definition
VPK_VTMB.cpp:212
vpkpp::VPK_VTMB::knownArchives
std::vector< uint32_t > knownArchives
Definition
VPK_VTMB.h:34
vpkpp::VPK_VTMB::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
VPK_VTMB.cpp:100
vpkpp::VPK_VTMB::addEntryInternal
void addEntryInternal(Entry &entry, const std::string &path, std::vector< std::byte > &buffer, EntryOptions options) override
Definition
VPK_VTMB.cpp:119
vpkpp::VPK_VTMB::getTruncatedFilestem
std::string getTruncatedFilestem() const override
/home/user/pak01_dir.vpk -> pak01
Definition
VPK_VTMB.cpp:206
vpkpp::VPK_VTMB::PackFile
PackFile(const PackFile &other)=delete
vpkpp::VPK_VTMB::openNumbered
void openNumbered(uint32_t archiveIndex, const std::string &path, const EntryCallback &callback)
Definition
VPK_VTMB.cpp:63
vpkpp::VPK_VTMB::currentArchive
uint32_t currentArchive
Definition
VPK_VTMB.h:35
vpkpp
Definition
Attribute.h:5
vpkpp::VPK_VTMB_EXTENSION
constexpr std::string_view VPK_VTMB_EXTENSION
Definition
VPK_VTMB.h:9
vpkpp::Attribute
Attribute
Definition
Attribute.h:7
vpkpp::BakeOptions
Definition
Options.h:20
vpkpp::EntryOptions
Definition
Options.h:34
include
vpkpp
format
VPK_VTMB.h
Generated on
for SourcePP by
1.16.1