pub struct ZipLocalFileHeader<'a> {Show 16 fields
pub version_required_to_extract: u16,
pub general_purpose_flags: u16,
pub compression_method: u16,
pub last_mod_time: u16,
pub last_mod_date: u16,
pub crc32: u32,
pub compressed_size: u32,
pub uncompressed_size: u32,
pub file_name_length: u16,
pub extra_field_length: u16,
pub file_name_raw: Vec<u8>,
pub extra_field: Vec<u8>,
pub compressed_data: Cow<'a, [u8]>,
pub data_descriptor: Option<ZipDataDescriptor>,
pub starting_position_with_signature: u64,
pub starting_position_without_signature: u64,
}
Expand description
An entry of local header of ZIP file
Fields
version_required_to_extract: u16
As the name implies; see 4.4.3 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
Unaffected by file renaming
general_purpose_flags: u16
See 4.4.4 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
bit #n reprents 1 << n in little endian
Unaffected by file renaming
compression_method: u16
As the name implies; see 4.4.5 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
Unaffected by file renaming
last_mod_time: u16
As the name implies; see 4.4.6 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
MS-DOS time: http://www.ffortune.net/calen/calen/etime.htm (Japanese)
Unaffected by file renaming
last_mod_date: u16
As the name implies; see 4.4.6 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
MS-DOS time: http://www.ffortune.net/calen/calen/etime.htm (Japanese)
Unaffected by file renaming
crc32: u32
See 4.4.7 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT
Unaffected by file renaming
compressed_size: u32
As the name implies. Note that the file name is not included.
uncompressed_size: u32
As the name implies. Note that the file name is not included.
file_name_length: u16
As the name implies.
extra_field_length: u16
As the name implies.
file_name_raw: Vec<u8>
Byte sequence of the file name.
extra_field: Vec<u8>
Byte sequence of extra field
compressed_data: Cow<'a, [u8]>
File content
data_descriptor: Option<ZipDataDescriptor>
Data descriptor just after the file content (exists only when bit #3 of general purpose flag is set)
starting_position_with_signature: u64
ローカルファイルヘッダの開始位置 (マジックナンバー) / (magick number of) local file header starting position
starting_position_without_signature: u64
ローカルファイルヘッダの開始位置 (マジックナンバーすぐ次) / Local file header starting position (next to magick number)
Implementations
sourceimpl ZipLocalFileHeader<'_>
impl ZipLocalFileHeader<'_>
sourcepub fn set_utf8_encoded_flag(&mut self)
pub fn set_utf8_encoded_flag(&mut self)
Sets bit #11 of general purpose bit to indicate that the file name & comment are encoded in UTF-8.
sourcepub fn set_file_name_from_slice(&mut self, name: &Vec<u8>)
pub fn set_file_name_from_slice(&mut self, name: &Vec<u8>)
sourcepub fn read_and_generate_from_signature<T: ReadBytesExt + Seek>(
read: &mut T
) -> Result<Self, ZipReadError>
pub fn read_and_generate_from_signature<T: ReadBytesExt + Seek>(
read: &mut T
) -> Result<Self, ZipReadError>
Reads local file header from the cjurrent position.
Arguments
read
- file handler (must be at the start of the signature)
sourcepub fn from_central_directory<T: ReadBytesExt + Seek>(
read: &mut T,
cd: &ZipCDEntry
) -> Result<Self, ZipReadError>
pub fn from_central_directory<T: ReadBytesExt + Seek>(
read: &mut T,
cd: &ZipCDEntry
) -> Result<Self, ZipReadError>
Examines the signature, reads the local file header and returns an instance that represents it
Arguments
read
- file handler (must be at the head of the signature)