class ZipTricks::Writer

Defined in:

writer.cr

Constant Summary

CRZT_COMMENT = "Written using cr_zip_tricks v.#{ZipTricks::VERSION}"
EIGHT_BYTE_MAX_UINT = UInt64::MAX
FOUR_BYTE_MAX_UINT = UInt32::MAX
MADE_BY_SIGNATURE = Bytes[52, 3]

A combination of the VERSION_MADE_BY low byte and the OS type high byte VERSION_MADE_BY = 52 os_type = 3 # UNIX [VERSION_MADE_BY, os_type].pack('CC')

TWO_BYTE_MAX_UINT = UInt16::MAX
VERSION_NEEDED_TO_EXTRACT = 20
VERSION_NEEDED_TO_EXTRACT_ZIP64 = 45

Instance Method Summary

Instance Method Detail

def dir_external_attrs #

[View source]
def file_external_attrs #

[View source]
def write_central_directory_file_header(io : IO, filename : String, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize, crc32 : ZipCRC32, gp_flags : ZipGpFlags, mtime : Time, storage_mode : ZipStorageMode, local_file_header_location : ZipLocation) #

[View source]
def write_data_descriptor(io : IO, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize, crc32 : ZipCRC32) #

[View source]
def write_end_of_central_directory(io : IO, start_of_central_directory_location : ZipLocation, central_directory_size : ZipLocation, num_files_in_archive : ZipLocation, comment : String = CRZT_COMMENT) #

[View source]
def write_int32_le(io : IO, val : Int) #

[View source]
def write_local_file_header(io : IO, filename : String, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize, crc32 : ZipCRC32, gp_flags : ZipGpFlags, mtime : Time, storage_mode : ZipStorageMode) #

[View source]
def write_timestamp_extra_field(io : IO, mtime : Time) #

Writes the extended timestamp information field. The spec defines 2 different formats - the one for the local file header can also accomodate the atime and ctime, whereas the one for the central directory can only take the mtime - and refers the reader to the local header extra to obtain the remaining times


[View source]
def write_uint16_le(io : IO, val : Int) #

[View source]
def write_uint32_le(io : IO, val : Int) #

[View source]
def write_uint64_le(io : IO, val : Int) #

[View source]
def write_uint8_le(io : IO, val : Int) #

[View source]
def write_zip64_extra_for_central_directory_file_header(io : IO, uncompressed_size : Int, compressed_size : Int, local_file_header_location : ZipLocation) #

[View source]
def write_zip64_extra_for_local_file_header(io : IO, compressed_size : ZipFilesize, uncompressed_size : ZipFilesize) #

[View source]