[][src]Struct ceres_mpq::Creator

pub struct Creator { /* fields omitted */ }

Creator capable of creating MPQ Version 1 archives.

Will hold all the files in memory until asked to write them to a writer.

When writing, a (listfile) will be automatically appended to the archive.

Methods

impl Creator[src]

pub fn add_file<C>(
    &mut self,
    file_name: &str,
    contents: C,
    options: FileOptions
) where
    C: Into<Vec<u8>>, 
[src]

Adds a file to be later written to the archive.

All forward slashes (/) in the file path will be auto-converted to backward slashes (\)

FileOptions determine the options for adding the file, e.g. encryption and compression.

pub fn write<W>(self, writer: W) -> Result<(), IoError> where
    W: Write + Seek
[src]

Writes out the entire archive to the specified writer.

The archive start position is calculated as follows:
((current_pos + (HEADER_BOUNDARY - 1)) / HEADER_BOUNDARY) * HEADER_BOUNDARY
Where current_pos is the writer's current seek pos, and HEADER_BOUNDARY is 512.

Will write the following:

  • MPQ Header
  • All files with their sector offset table
  • MPQ hash table
  • MPQ block table

Trait Implementations

impl Default for Creator[src]

impl Debug for Creator[src]

Auto Trait Implementations

impl Unpin for Creator

impl Send for Creator

impl Sync for Creator

impl RefUnwindSafe for Creator

impl UnwindSafe for Creator

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]