From 51694e1f0b2730915e0a57ec6d8de503cf06ef9a Mon Sep 17 00:00:00 2001 From: Igor Tolmachev Date: Thu, 27 Jun 2024 16:15:00 +0900 Subject: Create file driver and implement file reader --- src/zip/error.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/zip/error.rs') diff --git a/src/zip/error.rs b/src/zip/error.rs index 1c5527c..d82de78 100644 --- a/src/zip/error.rs +++ b/src/zip/error.rs @@ -8,6 +8,7 @@ pub type ZipResult = ArchiveResult; pub enum ZipError { EOCDRNotFound, InvalidEOCDR64Signature, + InvalidFileHeaderSignature, InvalidCDRSignature, InvalidArchiveComment, @@ -17,6 +18,8 @@ pub enum ZipError { InvalidTime, InvalidFileName, InvalidFileComment, + + NegativeFileOffset, } impl From for ArchiveError { @@ -38,6 +41,9 @@ impl Display for ZipError { "Invalid signature of zip64 end of central directory record" ) } + Self::InvalidFileHeaderSignature => { + write!(f, "Invalid file header signature") + } Self::InvalidCDRSignature => { write!(f, "Invalid signature of central directory record") } @@ -49,6 +55,8 @@ impl Display for ZipError { Self::InvalidTime => write!(f, "Invalid time"), Self::InvalidFileName => write!(f, "Invalid file name"), Self::InvalidFileComment => write!(f, "Invalid file comment"), + + Self::NegativeFileOffset => write!(f, "Negative file offset"), } } } -- cgit v1.2.3