pub struct ErfResource {
pub resref: ResRef,
pub name_as_read: Option<[u8; 16]>,
pub resource_type: ResourceTypeCode,
pub data: Vec<u8>,
}Expand description
One resource entry stored in an ERF-family archive.
Fields§
§resref: ResRefResource name (up to 16 bytes on disk).
name_as_read: Option<[u8; 16]>The key exactly as the file spelled it, when this came from one.
A ResRef folds case so a comparison is free, which is right for
resolution and loses what the file said. The engine’s own archives
spell most keys uppercase, and ExportFilesFromERF takes an extracted
file’s name straight off the key, so folding on the way out renames
every entry in a rewritten archive.
None for an entry built rather than read, which has no original to
keep and is written from Self::resref. Where both exist this wins:
letting them disagree silently is the failure that carrying it avoids.
resource_type: ResourceTypeCodeResource type code from the key table.
Unknown numeric IDs are preserved as raw values.
data: Vec<u8>Resource payload bytes.
Trait Implementations§
Source§impl Clone for ErfResource
impl Clone for ErfResource
Source§fn clone(&self) -> ErfResource
fn clone(&self) -> ErfResource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ErfResource
impl Debug for ErfResource
Source§impl PartialEq for ErfResource
impl PartialEq for ErfResource
Source§fn eq(&self, other: &ErfResource) -> bool
fn eq(&self, other: &ErfResource) -> bool
self and other values to be equal, and is used by ==.