|
wowlib 0.0.0
Read & write World of Warcraft client files — a C++26 core
|
The serialization face of a chunked entity, mixed in CRTP-style: an entity struct E : ChunkedFile<E> carries the ChunkExtras bookkeeping and gains the read()/write() methods every file representation shares. More...
#include <wowlib/formats/common/chunked_file.hpp>
Public Member Functions | |
| Result< void > | read (std::span< const std::byte > data) |
| Deserialize file bytes into this entity, replacing its contents. | |
| Result< FileBuffer > | write () const |
| Serialize this entity. | |
| 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(). | |
| bool | operator== (const ChunkedFile &) const =default |
| Public Member Functions inherited from wowlib::formats::ChunkExtras | |
| bool | operator== (const ChunkExtras &) const =default |
Additional Inherited Members | |
| Public Attributes inherited from wowlib::formats::ChunkExtras | |
| std::vector< JournalEntry > | journal |
| std::vector< UnknownChunk > | unknown |
| std::vector< std::byte > | trailing |
The serialization face of a chunked entity, mixed in CRTP-style: an entity struct E : ChunkedFile<E> carries the ChunkExtras bookkeeping and gains the read()/write() methods every file representation shares.
Method definitions sit at the bottom of this header, past the serializer engine they drive.
| Derived | the entity itself (the CRTP pattern). |
Definition at line 89 of file chunked_file.hpp.
|
nodiscard |
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
Definition at line 764 of file chunked_file.hpp.
References ensureValid(), and validate().
Referenced by ensureValid().
|
default |
| Result< void > wowlib::formats::ChunkedFile< Derived >::read | ( | std::span< const std::byte > | data | ) |
Deserialize file bytes into this entity, replacing its contents.
Unmodeled chunks are preserved so an unmodified entity rewrites byte-for-byte.
| data | the file bytes |
Definition at line 745 of file chunked_file.hpp.
References read(), and wowlib::formats::detail::readEntity().
Referenced by read(), and wowlib::formats::wdl::detail::WDL< V >::read().
|
nodiscard |
Definition at line 757 of file chunked_file.hpp.
References validate(), and wowlib::formats::detail::validateEntity().
Referenced by ensureValid(), and validate().
|
nodiscard |
Serialize this entity.
Definition at line 750 of file chunked_file.hpp.
References write(), and wowlib::formats::detail::writeEntity().
Referenced by write(), and wowlib::formats::wdl::detail::WDL< V >::write().