|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
The static composition of one client's file access: storage backend + listfile database + optional project-directory overlay. More...
#include <wowlib/fs/client_filesystem.hpp>
Public Member Functions | |
| ClientFileSystem (Backend backend, Listfile listfile={}, std::optional< ProjectDirectory > project=std::nullopt) | |
| Compose from ready components (backends are open by construction). | |
| Result< FileBuffer > | readFile (const FileKey &key) |
| Read a file by key. | |
| bool | exists (const FileKey &key) |
| Whether a file is reachable in the overlay or the storage. | |
| FileKey | resolve (const FileKey &key) const |
| Fill the missing half of a key (path or FileDataID) from the listfile, best-effort. | |
| Result< FileDataID > | addFile (std::string_view path, std::span< const std::byte > content) |
| Add (or overwrite) a file in the project directory. | |
| Backend & | backend () |
| Listfile & | listfile () |
| ProjectDirectory * | project () |
Static Public Member Functions | |
| static constexpr StorageKind | kind () |
The static composition of one client's file access: storage backend + listfile database + optional project-directory overlay.
Lookup precedence: project directory first (the ultimate patch), then the client storage.
| Backend | the storage backend (MpqStorage or CascStorage). |
| Listfile | the path<->FileDataID database provider. |
Definition at line 28 of file client_filesystem.hpp.
|
inline |
Compose from ready components (backends are open by construction).
| backend | the open storage backend. |
| listfile | the listfile database. |
| project | the overlay, if any. |
Definition at line 34 of file client_filesystem.hpp.
|
inline |
Add (or overwrite) a file in the project directory.
On a CASC-era client a new path is also registered in the listfile, allocating a custom FileDataID (the provider persists it to its working file).
| path | the client-internal path of the file. |
| content | the file contents. |
Definition at line 76 of file client_filesystem.hpp.
|
inline |
Definition at line 94 of file client_filesystem.hpp.
|
inline |
Whether a file is reachable in the overlay or the storage.
| key | the file identity. |
Definition at line 52 of file client_filesystem.hpp.
|
inlinestaticconstexpr |
Definition at line 91 of file client_filesystem.hpp.
|
inline |
Definition at line 97 of file client_filesystem.hpp.
|
inline |
Definition at line 100 of file client_filesystem.hpp.
|
inline |
Read a file by key.
Missing identity halves are filled from the listfile; the project directory wins over the client storage.
| key | the file identity (path, id, or both). |
Definition at line 41 of file client_filesystem.hpp.
|
inline |
Fill the missing half of a key (path or FileDataID) from the listfile, best-effort.
| key | the file identity. |
Definition at line 62 of file client_filesystem.hpp.
Referenced by wowlib::fs::ClientFileSystem< MpqStorage, NullListfile >::exists(), and wowlib::fs::ClientFileSystem< MpqStorage, NullListfile >::readFile().