Squeak Class Documentation category index | class index  
 
ZipArchiveMember
  category: System-Archives
  superclass: ArchiveMember
  subclasses: ZipDirectoryMember ZipFileMember ZipNewFileMember ZipStringMember

Subinstances of me are members in a ZipArchive.
They represent different data sources:
* ZipDirectoryMember -- a directory to be added to a zip file
* ZipFileMember -- a file or directory that is already in a zip file
* ZipNewFilemember -- a file that is to be added to a zip file
* ZipStringMember -- a string that is to be added to a zip file

They can write their data to another stream either copying, compressing,
or decompressing as desired.

instance methods
  TODO
  compressDataTo:
copyDataTo:
copyDataWithCRCTo:
copyRawDataTo:
readRawChunk:
writeDataTo:

  accessing
  centralDirectoryHeaderSize
clearExtraFields
compressedSize
compressionMethod
contentStream
contents
contentsFrom:to:
crc32
crc32String
desiredCompressionLevel
desiredCompressionLevel:
desiredCompressionMethod
desiredCompressionMethod:
extractToFileNamed:
fileComment
fileComment:
fileName
fileName:
lastModTime
setLastModFileDateTimeFrom:
uncompressedSize
unixFileAttributes
unixFileAttributes:

  initialization
  initialize

  private
  asDirectory
dosToUnixTime:
endRead
mapPermissionsFromUnix:
mapPermissionsToUnix:
unixToDosTime:
unixToSqueakTime:

  private-writing
  copyRawDataTo:from:to:
extractTo:
extractTo:from:to:
refreshLocalFileHeaderTo:
rewindData
writeCentralDirectoryFileHeaderTo:
writeDataDescriptorTo:
writeDataTo:from:to:
writeLocalFileHeaderTo:
writeTo:

  testing
  hasDataDescriptor
isDirectory
isEncrypted
isTextFile
isTextFile:
looksLikeDirectory

class methods
  instance creation
  new
newFromDirectory:
newFromFile:
newFromString:named:
newFromZipFile:named:

instance methods
  TODO top  
 

compressDataTo:

Copy my deflated data to the given stream.


 

copyDataTo:


 

copyDataWithCRCTo:

only used when compressionMethod = desiredCompressionMethod = CompressionStored


 

copyRawDataTo:


 

readRawChunk:


 

writeDataTo:

Copy my (possibly inflated or deflated) data to the given stream.
This might do compression, decompression, or straight copying, depending
on the values of compressionMethod and desiredCompressionMethod


  accessing top  
 

centralDirectoryHeaderSize


 

clearExtraFields


 

compressedSize

Return the compressed size for this member.
This will not be set for members that were constructed from strings
or external files until after the member has been written.


 

compressionMethod

Returns my compression method. This is the method that is
currently being used to compress my data.

This will be CompressionStored for added string or file members,
or CompressionStored or CompressionDeflated (others are possible but not handled)


 

contentStream

Answer my contents as a string.


 

contents

Answer my contents as a string.


 

contentsFrom:to:

Answer my contents as a string.


 

crc32


 

crc32String


 

desiredCompressionLevel


 

desiredCompressionLevel:

Set my desiredCompressionLevel
This is the method that will be used to write.
Returns prior desiredCompressionLevel.

Valid arguments are 0 (CompressionLevelNone) through 9,
including 6 (CompressionLevelDefault).

0 (CompressionLevelNone) will change the desiredCompressionMethod
to CompressionStored. All other arguments will change the
desiredCompressionMethod to CompressionDeflated.


 

desiredCompressionMethod

Get my desiredCompressionMethod.
This is the method that will be used to write


 

desiredCompressionMethod:

Set my desiredCompressionMethod
This is the method that will be used to write.
Answers prior desiredCompressionMethod.

Only CompressionDeflated or CompressionStored are valid arguments.

Changing to CompressionStored will change my desiredCompressionLevel
to CompressionLevelNone; changing to CompressionDeflated will change my
desiredCompressionLevel to CompressionLevelDefault.


 

extractToFileNamed:


 

fileComment


 

fileComment:


 

fileName


 

fileName:

Set my internal filename.
Returns the (possibly new) filename.
MUST BE IN UNIX FORM (slashes as separators, etc.)


 

lastModTime

Return my last modification date/time stamp,
converted to Squeak seconds


 

setLastModFileDateTimeFrom:


 

uncompressedSize

Return the uncompressed size for this member.


 

unixFileAttributes


 

unixFileAttributes:


  initialization top  
 

initialize


  private top  
 

asDirectory


 

dosToUnixTime:

DOS years start at 1980, Unix at 1970, and Smalltalk at 1901.
So the Smalltalk seconds will be high by 69 years when used as Unix time_t values.
So shift 1980 back to 1911...


 

endRead


 

mapPermissionsFromUnix:


 

mapPermissionsToUnix:


 

unixToDosTime:


 

unixToSqueakTime:


  private-writing top  
 

copyRawDataTo:from:to:


 

extractTo:


 

extractTo:from:to:


 

refreshLocalFileHeaderTo:

Re-writes my local header to the given stream.
To be called after writing the data stream.
Assumes that fileName and localExtraField sizes didn't change since last written.


 

rewindData


 

writeCentralDirectoryFileHeaderTo:

C2 v3 V4 v5 V2


 

writeDataDescriptorTo:

This writes a data descriptor to the given stream.
Assumes that crc32, writeOffset, and uncompressedSize are
set correctly (they should be after a write).
Further, the local file header should have the
GPBF_HAS_DATA_DESCRIPTOR_MASK (8) bit set.


 

writeDataTo:from:to:

Copy my (possibly inflated or deflated) data to the given stream.
But only the specified byte range.
This might do decompression, or straight copying, depending
on the values of compressionMethod and desiredCompressionMethod


 

writeLocalFileHeaderTo:

Write my local header to a file handle.
Stores the offset to the start of the header in my
writeLocalHeaderRelativeOffset member.


 

writeTo:


  testing top  
 

hasDataDescriptor


 

isDirectory


 

isEncrypted

Return true if this member is encrypted (this is unsupported)


 

isTextFile

Returns true if I am a text file.
Note that this module does not currently do anything with this flag
upon extraction or storage.
That is, bytes are stored in native format whether or not they came
from a text file.


 

isTextFile:

Set whether I am a text file.
Note that this module does not currently do anything with this flag
upon extraction or storage.
That is, bytes are stored in native format whether or not they came
from a text file.


 

looksLikeDirectory


class methods
  instance creation top  
 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


 

newFromDirectory:


 

newFromFile:


 

newFromString:named:


 

newFromZipFile:named: