[][src]Struct ceres_mpq::Archive

pub struct Archive<R: Read + Seek> { /* fields omitted */ }

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:

  1. Locate an MPQ header.
  2. Locate and read the Hash Table.
  3. 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

impl<R: Debug + Read + Seek> Debug for Archive<R>[src]

Auto Trait Implementations

impl<R> Unpin for Archive<R> where
    R: Unpin

impl<R> Send for Archive<R> where
    R: Send

impl<R> Sync for Archive<R> where
    R: Sync

impl<R> RefUnwindSafe for Archive<R> where
    R: RefUnwindSafe

impl<R> UnwindSafe for Archive<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]