SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
FPX.h
Go to the documentation of this file.
1// ReSharper disable CppRedundantQualifier
2
3#pragma once
4
5#include "VPK.h"
6
7namespace vpkpp {
8
9constexpr uint32_t FPX_SIGNATURE = 0x3241ff33;
10constexpr std::string_view FPX_DIR_SUFFIX = "_fdr";
11constexpr std::string_view FPX_EXTENSION = ".fpx";
12
13class FPX : public VPK {
14public:
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 static constexpr std::string_view GUID = "57D4C78A6198489C81D715D42DD21D2F";
22
23 [[nodiscard]] constexpr std::string_view getGUID() const override {
24 return FPX::GUID;
25 }
26
27protected:
28 using VPK::VPK;
29
30 [[nodiscard]] static std::unique_ptr<PackFile> openInternal(const std::string& path, const EntryCallback& callback = nullptr);
31
32private:
34 using VPK::sign;
35 using VPK::getVersion;
36 using VPK::setVersion;
37
39};
40
41} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition PackFile.h:255
static std::unique_ptr< PackFile > openInternal(const std::string &path, const EntryCallback &callback=nullptr)
Definition FPX.cpp:43
constexpr std::string_view getGUID() const override
Get the GUID corresponding to the pack file type.
Definition FPX.h:23
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open an FPX file.
Definition FPX.cpp:25
static std::unique_ptr< PackFile > create(const std::string &path)
Create a new directory FPX file - should end in "_dir.fpx"! This is not enforced but STRONGLY recomme...
Definition FPX.cpp:10
static constexpr std::string_view GUID
Definition FPX.h:21
EntryCallbackBase< void > EntryCallback
Definition PackFile.h:38
uint32_t getVersion() const
Returns 1 for v1, 2 for v2.
Definition VPK.cpp:887
static bool generateKeyPairFiles(const std::string &name)
Generate keypair files, which can be used to sign a VPK Input is a truncated file path,...
Definition VPK.cpp:804
void setVersion(uint32_t version)
Change the version of the VPK. Valid values are 1 and 2.
Definition VPK.cpp:891
bool sign(const std::string &filename_)
Sign the VPK with the given private key KeyValues file. (See below comment)
Definition VPK.cpp:835
constexpr uint32_t FPX_SIGNATURE
Definition FPX.h:9
constexpr std::string_view FPX_DIR_SUFFIX
Definition FPX.h:10
constexpr std::string_view FPX_EXTENSION
Definition FPX.h:11