Add support to pack xp3 files

This commit is contained in:
2025-10-10 20:52:45 +08:00
parent 021fe5b71a
commit 309bccd485
15 changed files with 692 additions and 4 deletions

View File

@@ -586,6 +586,11 @@ pub trait Script: std::fmt::Debug + std::any::Any {
pub trait Archive {
/// Creates a new file in the archive.
fn new_file<'a>(&'a mut self, name: &str) -> Result<Box<dyn WriteSeek + 'a>>;
/// Creates a new file in the archive that does not require seeking.
fn new_file_non_seek<'a>(&'a mut self, name: &str) -> Result<Box<dyn Write + 'a>> {
self.new_file(name)
.map(|f| Box::new(f) as Box<dyn Write + 'a>)
}
/// Writes the header of the archive. (Must be called after writing all files.)
fn write_header(&mut self) -> Result<()>;
}