SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
PakLump.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4
5#include <vpkpp/format/ZIP.h>
6
7namespace bsppp {
8
9constexpr std::string_view BSP_EXTENSION = ".bsp";
10
13class PakLump : public vpkpp::ZIP {
14public:
15 ~PakLump() override;
16
18 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
19
20 [[nodiscard]] constexpr bool isCaseSensitive() const noexcept override {
21 return false;
22 }
23
24 bool bake(const std::string& outputDir_ /*= ""*/, vpkpp::BakeOptions options /*= {}*/, const EntryCallback& callback /*= nullptr*/) override;
25
26 [[nodiscard]] explicit operator std::string() const override;
27
28protected:
29 explicit PakLump(const std::string& fullFilePath_);
30
31 const std::string tempPakLumpPath;
32 uint32_t version{};
33 uint32_t mapRevision{};
34
35private:
37};
38
39} // namespace bsppp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition PackFile.h:245
uint32_t version
Definition PakLump.h:32
uint32_t mapRevision
Definition PakLump.h:33
PakLump(const std::string &fullFilePath_)
Definition PakLump.cpp:16
bool bake(const std::string &outputDir_, vpkpp::BakeOptions options, const EntryCallback &callback) override
If output folder is an empty string, it will overwrite the original.
Definition PakLump.cpp:88
constexpr bool isCaseSensitive() const noexcept override
Does the format support case-sensitive file names?
Definition PakLump.h:20
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open a BSP file.
Definition PakLump.cpp:26
const std::string tempPakLumpPath
Definition PakLump.h:31
~PakLump() override
Definition PakLump.cpp:20
EntryCallbackBase< void > EntryCallback
Definition PackFile.h:38
Definition BSP.h:18
constexpr std::string_view BSP_EXTENSION
Definition PakLump.h:9