|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
A whole WMO (world map object) for one client version: the root file and all its group files unified as one entity. More...
#include <wowlib/formats/wmo/wmo.hpp>
Public Member Functions | |
| Result< void > | read (fs::FileSystem &fs, const FileKey &key) |
| Load the WMO and all its group files from a client filesystem, replacing this entity's contents. | |
| Result< void > | read (std::span< const std::byte > rootData, std::span< const std::span< const std::byte > > groupDatas) |
| Parse the WMO from already-loaded buffers (no filesystem access), replacing this entity's contents. | |
| Result< void > | write (fs::FileSystem &fs, const FileKey &key) const |
| Serialize and store the WMO (root and every group) through the filesystem's project overlay; group file names are derived from the root key, which must resolve to a path. | |
| ValidationReport | validate () const |
| Result< void > | ensureValid () const |
| Validate and raise on the first error instead of returning a report — the assert-style face of validate(). | |
Public Attributes | |
| WMORoot< V > | root {} |
| The root file contents. | |
| std::vector< WMOGroup< V > > | groups |
| The group files, in group order. | |
Static Public Attributes | |
| static constexpr ClientVersion | Version = V |
A whole WMO (world map object) for one client version: the root file and all its group files unified as one entity.
Instantiate through the canonicalizing wmo::WMO alias, never directly.
A WMO is a v17 world map object — a building, cave, bridge or other placed structure. It is stored as a root file (shared data: materials, doodads, portals, lights; see WMORoot) plus one file per group (the geometry; see WMOGroup). Group files are located by GFID (Legion+ clients) or the "{root}_NNN.wmo" naming convention. Reading is chunk-order independent; writing replays the original chunk order, so an entity read from a client and left unmodified rewrites byte-for-byte.
| V | the client version this assembly targets. |
|
nodiscard |
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
Definition at line 245 of file wmo.hpp.
References validate().
| Result< void > wowlib::formats::wmo::detail::WMO< V >::read | ( | fs::FileSystem & | fs, |
| const FileKey & | key ) |
Load the WMO and all its group files from a client filesystem, replacing this entity's contents.
| fs | the filesystem gateway |
| key | the root file identity (path and/or FileDataID) |
Definition at line 278 of file wmo.hpp.
References groups, wowlib::makeError(), wowlib::FileKey::path, wowlib::PathNotResolvable, and root.
| Result< void > wowlib::formats::wmo::detail::WMO< V >::read | ( | std::span< const std::byte > | rootData, |
| std::span< const std::span< const std::byte > > | groupDatas ) |
Parse the WMO from already-loaded buffers (no filesystem access), replacing this entity's contents.
Not welded: span-of-spans does not cross the binding boundary — the Python read() glue accepts a root buffer plus one buffer/file-like per group instead.
| rootData | the root file bytes. |
| groupDatas | one buffer per group file, in group order. |
Definition at line 258 of file wmo.hpp.
References groups, wowlib::makeError(), and root.
|
nodiscard |
Definition at line 156 of file wmo.hpp.
References wowlib::formats::ValidationReport::addError(), wowlib::formats::ValidationReport::addWarning(), wowlib::formats::detail::annotation(), groups, wowlib::formats::detail::memberNamed(), wowlib::formats::detail::membersOf(), root, wowlib::formats::detail::validateEntity(), and wowlib::formats::detail::validateIndexElements().
Referenced by ensureValid().
| Result< void > wowlib::formats::wmo::detail::WMO< V >::write | ( | fs::FileSystem & | fs, |
| const FileKey & | key ) const |
Serialize and store the WMO (root and every group) through the filesystem's project overlay; group file names are derived from the root key, which must resolve to a path.
| fs | the filesystem gateway |
| key | the root file identity; must resolve to a path |
Definition at line 328 of file wmo.hpp.
References groups, wowlib::InvalidEntityState, wowlib::makeError(), wowlib::FileKey::path, wowlib::PathNotResolvable, and root.
| std::vector<WMOGroup<V> > wowlib::formats::wmo::detail::WMO< V >::groups |
| WMORoot<V> wowlib::formats::wmo::detail::WMO< V >::root {} |
|
staticconstexpr |