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#pragma once
2
3#include "VPK.h"
4
5namespace vpkpp {
6
7constexpr uint32_t FPX_SIGNATURE = 0x3241ff33;
8constexpr std::string_view FPX_DIR_SUFFIX = "_fdr";
9constexpr std::string_view FPX_EXTENSION = ".fpx";
10
11class FPX : public VPK {
12public:
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 static constexpr inline std::string_view GUID = "57D4C78A6198489C81D715D42DD21D2F";
20
21 [[nodiscard]] constexpr std::string_view getGUID() const override {
22 return FPX::GUID;
23 }
24
25protected:
26 using VPK::VPK;
27
28 [[nodiscard]] static std::unique_ptr<PackFile> openInternal(const std::string& path, const EntryCallback& callback = nullptr);
29
30private:
32 using VPK::sign;
33 using VPK::getVersion;
34 using VPK::setVersion;
35
37};
38
39} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition: PackFile.h:242
Definition: FPX.h:11
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:21
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:19
EntryCallbackBase< void > EntryCallback
Definition: PackFile.h:30
Definition: VPK.h:24
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
Definition: Attribute.h:5
constexpr uint32_t FPX_SIGNATURE
Definition: FPX.h:7
constexpr std::string_view FPX_DIR_SUFFIX
Definition: FPX.h:8
constexpr std::string_view FPX_EXTENSION
Definition: FPX.h:9