Module: DooDah::LocalDirectoryHeader

Includes:
ZipEntryHeader
Included in:
ZipEntry
Defined in:
lib/doo_dah/zip_header.rb

Constant Summary

Constants included from ZipEntryHeader

ZipEntryHeader::CENTRAL_ENTRY_HEADER_SIGNATURE, ZipEntryHeader::DEFLATED, ZipEntryHeader::END_CENTRAL_DIRECTORY_SIGNATURE, ZipEntryHeader::GP_FLAGS_CRC_UNKNOWN, ZipEntryHeader::GP_FLAGS_UTF8, ZipEntryHeader::LOCAL_ENTRY_FOOTER_SIGNATURE, ZipEntryHeader::LOCAL_ENTRY_HEADER_SIGNATURE, ZipEntryHeader::LOCAL_ENTRY_STATIC_HEADER_LENGTH, ZipEntryHeader::LOCAL_ENTRY_TRAILING_DESCRIPTOR_LENGTH, ZipEntryHeader::STORED, ZipEntryHeader::VERSION_NEEDED_TO_EXTRACT

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ZipEntryHeader

common_header_size, name_size, #write_common_header, #write_infozip_utf8_name, #write_name

Methods included from ZipHeader

signature_size, #write_signature

Class Method Details



94
95
96
# File 'lib/doo_dah/zip_header.rb', line 94

def self.local_footer_size
  ZipHeader.signature_size + 12
end

.local_header_size(name) ⇒ Object



90
91
92
# File 'lib/doo_dah/zip_header.rb', line 90

def self.local_header_size(name)
  ZipHeader.signature_size + ZipEntryHeader.common_header_size + ZipEntryHeader.name_size(name)
end

Instance Method Details



105
106
107
108
# File 'lib/doo_dah/zip_header.rb', line 105

def write_local_footer
  write_signature(LOCAL_ENTRY_FOOTER_SIGNATURE)
  write([crc, size, size].pack('VVV'))
end

#write_local_headerObject



98
99
100
101
102
103
# File 'lib/doo_dah/zip_header.rb', line 98

def write_local_header
  self.local_header_offset = current_offset
  write_signature(LOCAL_ENTRY_HEADER_SIGNATURE)
  write_common_header
  write_name
end