SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Toggle main menu visibility
Loading...
Searching...
No Matches
GRP.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
int8_t
GRP_FILENAME_MAX_SIZE
= 12;
10
constexpr
std::string_view
GRP_SIGNATURE
=
"KenSilverman"
;
11
constexpr
std::string_view
GRP_EXTENSION
=
".grp"
;
12
13
class
GRP
:
public
PackFile
{
14
public
:
16
static
std::unique_ptr<PackFile>
create
(
const
std::string& path);
17
19
[[nodiscard]]
static
std::unique_ptr<PackFile>
open
(
const
std::string& path,
const
EntryCallback
& callback =
nullptr
);
20
21
[[nodiscard]] std::optional<std::vector<std::byte>>
readEntry
(
const
std::string& path_)
const override
;
22
23
bool
bake
(
const
std::string& outputDir_
/*= ""*/
,
BakeOptions
options
/*= {}*/
,
const
EntryCallback
& callback
/*= nullptr*/
)
override
;
24
25
[[nodiscard]]
Attribute
getSupportedEntryAttributes
()
const override
;
26
27
protected
:
28
using
PackFile::PackFile
;
29
30
void
addEntryInternal
(
Entry
& entry,
const
std::string& path, std::vector<std::byte>& buffer,
EntryOptions
options)
override
;
31
32
private
:
33
VPKPP_REGISTER_PACKFILE_OPEN(
GRP_EXTENSION
, &
GRP::open
);
34
};
35
36
}
// namespace vpkpp
PackFile.h
vpkpp::Entry
This class represents the metadata that a file has inside a PackFile.
Definition
Entry.h:14
vpkpp::GRP
Definition
GRP.h:13
vpkpp::GRP::open
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a GRP file.
Definition
GRP.cpp:22
vpkpp::GRP::create
static std::unique_ptr< PackFile > create(const std::string &path)
Create a GRP file.
Definition
GRP.cpp:12
vpkpp::GRP::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
GRP.cpp:63
vpkpp::GRP::PackFile
PackFile(const PackFile &other)=delete
vpkpp::GRP::bake
bool bake(const std::string &outputDir_, BakeOptions options, const EntryCallback &callback) override
If output folder is an empty string, it will overwrite the original.
Definition
GRP.cpp:89
vpkpp::GRP::getSupportedEntryAttributes
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
Definition
GRP.cpp:144
vpkpp::GRP::addEntryInternal
void addEntryInternal(Entry &entry, const std::string &path, std::vector< std::byte > &buffer, EntryOptions options) override
Definition
GRP.cpp:82
vpkpp::PackFile::EntryCallback
EntryCallbackBase< void > EntryCallback
Definition
PackFile.h:38
vpkpp::PackFile::PackFile
PackFile(const PackFile &other)=delete
vpkpp
Definition
Attribute.h:5
vpkpp::GRP_SIGNATURE
constexpr std::string_view GRP_SIGNATURE
Definition
GRP.h:10
vpkpp::GRP_EXTENSION
constexpr std::string_view GRP_EXTENSION
Definition
GRP.h:11
vpkpp::Attribute
Attribute
Definition
Attribute.h:7
vpkpp::GRP_FILENAME_MAX_SIZE
constexpr int8_t GRP_FILENAME_MAX_SIZE
Definition
GRP.h:9
vpkpp::BakeOptions
Definition
Options.h:20
vpkpp::EntryOptions
Definition
Options.h:34
include
vpkpp
format
GRP.h
Generated on
for SourcePP by
1.18.0