|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
#include <wowlib/fs/filesystem.hpp>
Public Member Functions | |
| Result< FileBuffer > | readFile (const FileKey &key) |
| Result< FileBuffer > | readFile (std::string_view path) |
| Read a file by client-internal path. | |
| Result< FileBuffer > | readFile (FileDataID fdid) |
| Read a file by FileDataID. | |
| bool | exists (const FileKey &key) |
| Whether a file is reachable in the overlay or the storage. | |
| bool | exists (std::string_view path) |
| Whether a path is reachable. | |
| bool | exists (FileDataID fdid) |
| Whether a FileDataID is reachable. | |
| Result< std::vector< std::string > > | enumeratePaths () |
| FileKey | resolve (const FileKey &key) const |
| Result< FileDataID > | addFile (std::string_view path, std::span< const std::byte > content) |
| Result< void > | importKeys (std::string_view keyList) |
| Register TACT encryption keys (CASC clients only) so the storage can decrypt content behind them — including the encrypted sections of a .db2, which then decode normally instead of being reported encrypted. | |
| Result< void > | addEncryptionKey (std::uint64_t keyName, std::span< const std::byte, 16 > key) |
| Register one TACT encryption key (CASC clients only). | |
| StorageKind | kind () const |
| Which storage technology backs this filesystem: Mpq or Casc. | |
| ClientVersion | version () const |
| The client version this filesystem was opened for — the anchor of version-agnostic code (expansion_of, for_version, Table.open). | |
| MpqFileSystem * | mpq () |
| The MPQ composition, for C++ callers that want the static types. | |
| CascFileSystem * | casc () |
| The CASC composition, for C++ callers that want the static types. | |
| FileSystem (MpqFileSystem impl, ClientVersion version) | |
| C++-only; target languages construct through open(). | |
| FileSystem (CascFileSystem impl, ClientVersion version) | |
| C++-only; target languages construct through open(). | |
Static Public Member Functions | |
| static Result< FileSystem > | open (FileSystemSettings settings) |
Protected Member Functions | |
| void | close () |
| bool | isOpen () const |
| Whether the filesystem still holds its storage (false after close()). | |
Definition at line 64 of file filesystem.hpp.
|
inlineexplicit |
C++-only; target languages construct through open().
| impl | the ready MPQ composition. |
| version | the client version the composition was opened for. |
Definition at line 166 of file filesystem.hpp.
References version().
Referenced by open().
|
inlineexplicit |
C++-only; target languages construct through open().
| impl | the ready CASC composition. |
| version | the client version the composition was opened for. |
Definition at line 172 of file filesystem.hpp.
References version().
|
inline |
Register one TACT encryption key (CASC clients only).
C++-only; scripting callers use importKeys with the text format.
| keyName | the 64-bit key lookup (a section's tactKeyHash). |
| key | the 16-byte key. |
Definition at line 144 of file filesystem.hpp.
References casc(), wowlib::makeError(), and wowlib::NotSupported.
| Result< FileDataID > wowlib::fs::FileSystem::addFile | ( | std::string_view | path, |
| std::span< const std::byte > | content ) |
| path | the client-internal path of the file |
| content | the file contents |
Definition at line 140 of file filesystem.cpp.
|
inline |
The CASC composition, for C++ callers that want the static types.
Definition at line 161 of file filesystem.hpp.
Referenced by addEncryptionKey(), and importKeys().
|
inlineprotected |
Definition at line 179 of file filesystem.hpp.
| Result< std::vector< std::string > > wowlib::fs::FileSystem::enumeratePaths | ( | ) |
Definition at line 110 of file filesystem.cpp.
| bool wowlib::fs::FileSystem::exists | ( | const FileKey & | key | ) |
Whether a file is reachable in the overlay or the storage.
| key | the file identity (path, id, or both) |
Definition at line 103 of file filesystem.cpp.
|
inline |
Whether a FileDataID is reachable.
| fdid | the numeric file identifier |
Definition at line 109 of file filesystem.hpp.
References exists().
|
inline |
Whether a path is reachable.
| path | the client-internal file path |
Definition at line 101 of file filesystem.hpp.
References exists().
|
inline |
Register TACT encryption keys (CASC clients only) so the storage can decrypt content behind them — including the encrypted sections of a .db2, which then decode normally instead of being reported encrypted.
Takes the community "KeyName KeyHex" per-line text format.
| keyList | the newline-separated key list. |
| keyList | newline-separated 'KeyName KeyHex' lines |
Definition at line 134 of file filesystem.hpp.
References casc(), wowlib::makeError(), and wowlib::NotSupported.
|
inlineprotected |
Whether the filesystem still holds its storage (false after close()).
Definition at line 182 of file filesystem.hpp.
|
inline |
Which storage technology backs this filesystem: Mpq or Casc.
A static fact of the opened client; remains valid after close().
Definition at line 150 of file filesystem.hpp.
|
inline |
The MPQ composition, for C++ callers that want the static types.
Definition at line 157 of file filesystem.hpp.
|
static |
| settings | what to open and how |
Definition at line 47 of file filesystem.cpp.
References wowlib::ClientVersion::build, wowlib::fs::FileSystemSettings::cascProduct, wowlib::fs::FileSystemSettings::clientPath, FileSystem(), wowlib::fs::FileSystemSettings::listfileCsv, wowlib::fs::CsvListfile::load(), wowlib::fs::FileSystemSettings::locale, wowlib::Mpq, wowlib::fs::CascStorage::open(), wowlib::fs::MpqStorage::open(), wowlib::fs::ProjectDirectory::open(), wowlib::fs::FileSystemSettings::projectDirectory, and wowlib::fs::FileSystemSettings::version.
| Result< FileBuffer > wowlib::fs::FileSystem::readFile | ( | const FileKey & | key | ) |
| key | the file identity (path, id, or both) |
Definition at line 96 of file filesystem.cpp.
Referenced by readFile(), and readFile().
|
inline |
Read a file by FileDataID.
| fdid | the numeric file identifier |
Definition at line 86 of file filesystem.hpp.
References readFile().
|
inline |
Read a file by client-internal path.
| path | the client-internal file path |
Definition at line 78 of file filesystem.hpp.
References readFile().
| key | the file identity to complete |
Definition at line 133 of file filesystem.cpp.
|
inline |
The client version this filesystem was opened for — the anchor of version-agnostic code (expansion_of, for_version, Table.open).
A static fact of the opened client; remains valid after close().
Definition at line 153 of file filesystem.hpp.
Referenced by FileSystem(), and FileSystem().