wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
Loading...
Searching...
No Matches
wowlib::fs::StorageBackend Concept Reference

The storage backend contract: what MpqStorage and CascStorage implement and ClientFileSystem composes over. More...

#include <wowlib/fs/storage_backend.hpp>

Concept definition

template<typename B>
concept StorageBackend = std::movable<B> && requires(B b, const FileKey& key) {
{ b.readFile(key) } -> std::same_as<Result<FileBuffer>>; { b.exists(key) } -> std::same_as<bool>; {
B::kind()
} -> std::same_as<StorageKind>;
}
The storage backend contract: what MpqStorage and CascStorage implement and ClientFileSystem composes...

Detailed Description

The storage backend contract: what MpqStorage and CascStorage implement and ClientFileSystem composes over.

Backends are RAII: constructed open (through their static Result-returning factories, whose Options differ per backend) and closed by their destructors — the concept only spells the usage surface. readFile/exists are thread-safe. Not bound — static polymorphism only.

Template Parameters
Bthe backend type under test.

Definition at line 20 of file storage_backend.hpp.