[−][src]Struct ceres_mpq::Creator
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]
&mut self,
file_name: &str,
contents: C,
options: FileOptions
) where
C: Into<Vec<u8>>,
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]
W: Write + Seek,
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
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]
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,