pub struct ListfileResolver { /* private fields */ }Expand description
A file resolver that uses a listfile mapping from FileDataID to file path This is the most common implementation for WoW file resolution
Implementations§
Source§impl ListfileResolver
impl ListfileResolver
Sourcepub fn with_base_path<P: AsRef<Path>>(base_path: P) -> Self
pub fn with_base_path<P: AsRef<Path>>(base_path: P) -> Self
Create a new listfile resolver with a base path
Sourcepub fn load_from_csv<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn load_from_csv<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Load mappings from a CSV file (FileDataID;filepath format)
Sourcepub fn load_from_text<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn load_from_text<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Load mappings from a simple text file (one “ID filepath” per line)
Sourcepub fn add_mapping<S: Into<String>>(&mut self, id: u32, path: S)
pub fn add_mapping<S: Into<String>>(&mut self, id: u32, path: S)
Add a manual mapping from FileDataID to file path
Sourcepub fn remove_mapping(&mut self, id: u32) -> Option<String>
pub fn remove_mapping(&mut self, id: u32) -> Option<String>
Remove a mapping by FileDataID
Sourcepub fn set_base_path<P: AsRef<Path>>(&mut self, base_path: P)
pub fn set_base_path<P: AsRef<Path>>(&mut self, base_path: P)
Set the base path for file resolution
Trait Implementations§
Source§impl Debug for ListfileResolver
impl Debug for ListfileResolver
Source§impl Default for ListfileResolver
impl Default for ListfileResolver
Source§impl FileResolver for ListfileResolver
impl FileResolver for ListfileResolver
Auto Trait Implementations§
impl Freeze for ListfileResolver
impl RefUnwindSafe for ListfileResolver
impl Send for ListfileResolver
impl Sync for ListfileResolver
impl Unpin for ListfileResolver
impl UnwindSafe for ListfileResolver
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().