[−][src]Struct ceres_mpq::Archive
Implementation of a MoPaQ archive viewer.
Refer to top-level documentation to see which features are supported.
Will work on any reader that implements Read + Seek
.
Methods
impl<R: Read + Seek> Archive<R>
[src]
pub fn open(reader: R) -> Result<Archive<R>, Error>
[src]
Try to open an MPQ archive from the specified reader
.
Immediately, this will perform the following:
- Locate an MPQ header.
- Locate and read the Hash Table.
- Locate and read the Block Table.
If any of these steps fail, the archive is deemed corrupted and an appropriate error is returned.
No other operations will be performed.
pub fn read_file(&mut self, name: &str) -> Result<Vec<u8>, Error>
[src]
Read a file's contents.
Notably, the filename resolution algorithm
is case-insensitive, and will treat backslashes (\
) and forward slashes (/
)
as the same character.
Does not support single-unit files or uncompressed files.
pub fn files(&mut self) -> Option<Vec<String>>
[src]
If the archive contains a (listfile)
, this will method
parse it and return a Vec
containing all known filenames.
pub fn start(&self) -> u64
[src]
pub fn end(&self) -> u64
[src]
pub fn size(&self) -> u64
[src]
pub fn reader(&mut self) -> &mut R
[src]
Trait Implementations
Auto Trait Implementations
impl<R> Unpin for Archive<R> where
R: Unpin,
R: Unpin,
impl<R> Send for Archive<R> where
R: Send,
R: Send,
impl<R> Sync for Archive<R> where
R: Sync,
R: Sync,
impl<R> RefUnwindSafe for Archive<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> UnwindSafe for Archive<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,