class FormatParser::ZIPParser::FileReader::ZipEntry

Represents a file within the ZIP archive being read

Attributes

comment[RW]

@return [String] the file comment

compressed_size[RW]

@return [Fixnum] size of compressed file data in the ZIP

crc32[RW]

@return [Fixnum] the CRC32 checksum of this file

disk_number_start[RW]

@return [Fixnum] disk number where this file starts

dos_date[RW]

@return [Fixnum] the bit-packed DOS date

dos_time[RW]

@return [Fixnum] the bit-packed DOS time

external_attrs[RW]

@return [Fixnum] external attributes of the file

filename[RW]

@return [String] the filename

gp_flags[RW]

@return [Fixnum] bit-packed general purpose flags

internal_attrs[RW]

@return [Fixnum] internal attributes of the file

local_file_header_offset[RW]

@return [Fixnum] at what offset the local file header starts

in your original IO object
made_by[RW]

@return [Fixnum] bit-packed version signature of the program that made the archive

storage_mode[RW]

@return [Fixnum] Storage mode (0 for stored, 8 for deflate)

uncompressed_size[RW]

@return [Fixnum] size of the file once uncompressed

version_needed_to_extract[RW]

@return [Fixnum] ZIP version support needed to extract this file

Public Instance Methods

compressed_data_offset() click to toggle source

@return [Fixnum] at what offset you should start reading

for the compressed data in your original IO object
# File lib/parsers/zip_parser/file_reader.rb, line 129
def compressed_data_offset
  @compressed_data_offset || raise(LocalHeaderPending)
end
compressed_data_offset=(offset) click to toggle source

Sets the offset at which the compressed data for this file starts in the ZIP. By default, the value will be set by the Reader for you. If you use delayed reading, you need to set it by using the `get_compressed_data_offset` on the Reader:

entry.compressed_data_offset = reader.get_compressed_data_offset(io: file,
       local_file_header_offset: entry.local_header_offset)
# File lib/parsers/zip_parser/file_reader.rb, line 151
def compressed_data_offset=(offset)
  @compressed_data_offset = offset.to_i
end
known_offset?() click to toggle source

Tells whether the compressed data offset is already known for this entry @return [Boolean]

# File lib/parsers/zip_parser/file_reader.rb, line 135
def known_offset?
  !@compressed_data_offset.nil?
end
uses_data_descriptor?() click to toggle source

Tells whether the entry uses a data descriptor (this is defined by bit 3 in the GP flags).

# File lib/parsers/zip_parser/file_reader.rb, line 141
def uses_data_descriptor?
  (gp_flags & 0x0008) == 0x0008
end