SourcePP
Several modern C++20 libraries for sanely parsing Valve's formats.
Loading...
Searching...
No Matches
OL.h
Go to the documentation of this file.
1// ReSharper disable CppRedundantQualifier
2
3#pragma once
4
5#include "../PackFile.h"
6
7namespace vpkpp {
8
9constexpr std::string_view OL_SIGNATURE = "Worldcraft Prefab Library\x0d\x0a\x1a";
10constexpr std::string_view OL_EXTENSION = ".ol";
11
12class OL : public PackFileReadOnly {
13public:
15 [[nodiscard]] static std::unique_ptr<PackFile> open(const std::string& path, const EntryCallback& callback = nullptr);
16
17 [[nodiscard]] constexpr bool isCaseSensitive() const override {
18 return true;
19 }
20
21 [[nodiscard]] std::optional<std::vector<std::byte>> readEntry(const std::string& path_) const override;
22
23 [[nodiscard]] Attribute getSupportedEntryAttributes() const override;
24
25 [[nodiscard]] const std::string& getNotes() const;
26
27 [[nodiscard]] std::optional<std::string> getEntryNotes(const std::string& path) const;
28
29protected:
31
32 std::string notes;
33
34private:
36};
37
38} // namespace vpkpp
#define VPKPP_REGISTER_PACKFILE_OPEN(extension, function)
Definition PackFile.h:245
Definition OL.h:12
Attribute getSupportedEntryAttributes() const override
Returns a list of supported entry attributes Mostly for GUI programs that show entries and their meta...
Definition OL.cpp:113
static std::unique_ptr< PackFile > open(const std::string &path, const EntryCallback &callback=nullptr)
Open an OL file.
Definition OL.cpp:19
std::string notes
Definition OL.h:32
constexpr bool isCaseSensitive() const override
Does the format support case-sensitive file names?
Definition OL.h:17
std::optional< std::string > getEntryNotes(const std::string &path) const
Definition OL.cpp:122
std::optional< std::vector< std::byte > > readEntry(const std::string &path_) const override
Try to read the entry's data to a bytebuffer.
Definition OL.cpp:94
PackFileReadOnly(const std::string &fullFilePath_)
Definition PackFile.cpp:728
const std::string & getNotes() const
Definition OL.cpp:118
PackFileReadOnly(const std::string &fullFilePath_)
Definition PackFile.cpp:728
EntryCallbackBase< void > EntryCallback
Definition PackFile.h:38
constexpr std::string_view OL_SIGNATURE
Definition OL.h:9
constexpr std::string_view OL_EXTENSION
Definition OL.h:10
Attribute
Definition Attribute.h:7