use crate::{file::ZipFile, string::ZipString};
pub struct ZipFileBuilder(pub(crate) ZipFile);
impl From<ZipFile> for ZipFileBuilder {
fn from(file: ZipFile) -> Self {
Self(file)
}
}
impl Default for ZipFileBuilder {
fn default() -> Self {
ZipFileBuilder(ZipFile { entries: Vec::new(), zip64: false, comment: String::new().into() })
}
}
impl ZipFileBuilder {
pub fn new() -> Self {
Self::default()
}
pub fn comment(mut self, comment: ZipString) -> Self {
self.0.comment = comment;
self
}
pub fn build(self) -> ZipFile {
self.into()
}
}