Struct zifu::zip_central_directory::ZipCDEntry[][src]

pub struct ZipCDEntry {
    pub version_made_by: u16,
    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_comment_length: u16,
    pub disk_number_start: u16,
    pub internal_file_attributes: u16,
    pub external_file_attributes: u32,
    pub local_header_position: u32,
    pub file_name_raw: Vec<u8>,
    pub extra_field: Vec<u8>,
    pub file_comment: Vec<u8>,
    pub starting_position_with_signature: u64,
    pub starting_position_without_signature: u64,
}

ZIPファイルのセントラルディレクトリの1エントリー An entry of central directory of ZIP file

Fields

version_made_by: u16

As the name implies; see 4.4.2 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

Unaffected by file renaming

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_comment_length: u16

As the name implies.

disk_number_start: u16

the number (0-baesd) of the disk where the file for this central directory is.

Unaffected by file renaming

internal_file_attributes: u16

See 4.4.14 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

Unaffected by file renaming

external_file_attributes: u32

See 4.4.15 in https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT

Unaffected by file renaming

local_header_position: u32

Absolute 0-based position of the local header for this central directory

file_name_raw: Vec<u8>

Byte sequence of the file name.

extra_field: Vec<u8>

Byte sequence of extra field

file_comment: Vec<u8>

File comment; must be encoded in the same encoding as the file name.

starting_position_with_signature: u64

セントラルディレクトリの開始位置 (マジックナンバー) / (magick number of) central directory starting position

starting_position_without_signature: u64

セントラルディレクトリの開始位置 (マジックナンバーすぐ次) / Central directory starting position (next to magick number)

Implementations

impl ZipCDEntry[src]

pub fn set_utf8_encoded_flag(&mut self)[src]

Sets bit #11 of general purpose bit to indicate that the file name & comment are encoded in UTF-8.

pub fn set_file_name_from_slice(&mut self, name: &Vec<u8>)[src]

Replaces the file name.

Arguments

  • name - Slice of new name

pub fn set_file_coment_from_slice(&mut self, comment: &Vec<u8>)[src]

Replaces the file comment

Arguments

  • comment - Slice of new comment

pub fn is_encoded_in_utf8(&self) -> bool[src]

Returns whether the file name and comment are explicitly encoded in UTF-8

pub fn is_encrypted_data(&self) -> bool[src]

Returns whether the file content is encrypted

pub fn check_unsupported(&self) -> Result<(), ZipReadError>[src]

Returns Error if the file and central directory have unsupported features

pub fn write<T: WriteBytesExt>(&self, write: &mut T) -> Result<u64>[src]

Writes the content of this central directory to file and returns the number of bytes written.

Arguments

  • write - file handler

pub fn all_from_eocd<T: ReadBytesExt + Seek>(
    mut read: &mut T,
    eocd: &ZipEOCD
) -> Result<Vec<Self>, ZipReadError>
[src]

Reads and returns a central directory sequence from the given EOCD

Arguments

  • read - file handler
  • eocd - EOCD object

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.