author | Claus Gittinger <cg@exept.de> |
Tue, 07 Apr 1998 15:09:42 +0200 | |
changeset 634 | 3b4686d35664 |
parent 633 | baa3e20e50b2 |
child 635 | e1cd2823530b |
permissions | -rw-r--r-- |
624 | 1 |
" |
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
622 | 13 |
|
14 |
Object subclass:#ZipArchive |
|
624 | 15 |
instanceVariableNames:'file mode archiveName firstEntry lastEntry' |
628
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
16 |
classVariableNames:'RecentlyUsedZipArchives ECREC_SIZE LREC_SIZE CREC_SIZE |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
17 |
SIZE_CENTRAL_DIRECTORY TOTAL_ENTRIES_CENTRAL_DIR |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
18 |
C_COMPRESSED_SIZE C_RELATIVE_OFFSET_LOCAL_HEADER |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
19 |
C_FILENAME_LENGTH C_UNCOMPRESSED_SIZE ZipFileFormatErrorSignal |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
20 |
COMPR_STORED COMPR_SHRUNK COMPR_REDUCED1 COMPR_REDUCED2 |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
21 |
COMPR_REDUCED3 COMPR_REDUCED4 COMPR_IMPLODED COMPR_TOKENIZED |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
22 |
COMPR_DEFLATED' |
622 | 23 |
poolDictionaries:'' |
24 |
category:'System-Support-FileFormats' |
|
25 |
! |
|
26 |
||
27 |
Object subclass:#ZipMember |
|
28 |
instanceVariableNames:'next relative_offset_local_header compressed_size |
|
29 |
uncompressed_size name crc32 compression_method' |
|
30 |
classVariableNames:'' |
|
31 |
poolDictionaries:'' |
|
32 |
privateIn:ZipArchive |
|
33 |
! |
|
34 |
||
35 |
!ZipArchive class methodsFor:'documentation'! |
|
36 |
||
624 | 37 |
copyright |
38 |
" |
|
39 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
40 |
All Rights Reserved |
|
41 |
||
42 |
This software is furnished under a license and may be used |
|
43 |
only in accordance with the terms of that license and with the |
|
44 |
inclusion of the above copyright notice. This software may not |
|
45 |
be provided or otherwise made available to, or used by, any |
|
46 |
other person. No title to or ownership of the software is |
|
47 |
hereby transferred. |
|
48 |
" |
|
49 |
||
50 |
! |
|
622 | 51 |
|
624 | 52 |
documentation |
53 |
" |
|
54 |
provides access to a zip archive. |
|
55 |
Caveat: only uncompressed archives are supported (for now). |
|
56 |
" |
|
57 |
! |
|
58 |
||
59 |
examples |
|
60 |
" |
|
633 | 61 |
[exBegin] |
624 | 62 |
|zip bytes| |
63 |
||
64 |
zip := ZipArchive oldFileNamed:'foo.zip'. |
|
65 |
bytes := zip extract:'bar'. |
|
633 | 66 |
[exEnd] |
624 | 67 |
" |
622 | 68 |
! ! |
69 |
||
70 |
!ZipArchive class methodsFor:'instance creation'! |
|
71 |
||
72 |
newFileNamed:name |
|
73 |
^ self new name:name mode:#write |
|
74 |
||
75 |
"Created: / 29.3.1998 / 17:46:16 / cg" |
|
76 |
! |
|
77 |
||
78 |
oldFileNamed:name |
|
628
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
79 |
|zar f| |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
80 |
|
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
81 |
f := name asFilename. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
82 |
RecentlyUsedZipArchives isNil ifTrue:[ |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
83 |
RecentlyUsedZipArchives := OrderedCollection new |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
84 |
]. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
85 |
RecentlyUsedZipArchives keysAndValuesDo:[:i :z | |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
86 |
z name = name ifTrue:[ |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
87 |
RecentlyUsedZipArchives removeIndex:i. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
88 |
RecentlyUsedZipArchives addLast:z. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
89 |
^ z |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
90 |
]. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
91 |
]. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
92 |
zar := self new name:f mode:#read. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
93 |
RecentlyUsedZipArchives add:zar. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
94 |
[RecentlyUsedZipArchives size > 5] whileTrue:[ |
633 | 95 |
RecentlyUsedZipArchives removeFirst |
628
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
96 |
]. |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
97 |
^ zar |
622 | 98 |
|
99 |
"Created: / 29.3.1998 / 17:46:09 / cg" |
|
633 | 100 |
"Modified: / 7.4.1998 / 14:32:24 / cg" |
622 | 101 |
! ! |
102 |
||
103 |
!ZipArchive class methodsFor:'class initialization'! |
|
104 |
||
105 |
initialize |
|
106 |
ECREC_SIZE := 18. |
|
107 |
LREC_SIZE := 26. |
|
108 |
CREC_SIZE := 42. |
|
109 |
||
110 |
TOTAL_ENTRIES_CENTRAL_DIR := 10. |
|
111 |
SIZE_CENTRAL_DIRECTORY := 12. |
|
112 |
||
113 |
C_COMPRESSED_SIZE := 16. |
|
114 |
C_UNCOMPRESSED_SIZE := 20. |
|
115 |
C_FILENAME_LENGTH := 24. |
|
116 |
C_RELATIVE_OFFSET_LOCAL_HEADER := 38. |
|
117 |
||
118 |
"/ compression methods |
|
119 |
COMPR_STORED := 0. |
|
120 |
COMPR_SHRUNK := 1. |
|
121 |
COMPR_REDUCED1 := 2. |
|
122 |
COMPR_REDUCED2 := 3. |
|
123 |
COMPR_REDUCED3 := 4. |
|
124 |
COMPR_REDUCED4 := 5. |
|
125 |
COMPR_IMPLODED := 6. |
|
126 |
COMPR_TOKENIZED := 7. |
|
127 |
COMPR_DEFLATED := 8. |
|
128 |
||
129 |
ZipFileFormatErrorSignal := Signal new. |
|
130 |
||
131 |
" |
|
132 |
self initialize |
|
133 |
" |
|
134 |
||
135 |
"Modified: / 29.3.1998 / 20:17:18 / cg" |
|
136 |
! ! |
|
137 |
||
629
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
138 |
!ZipArchive class methodsFor:'cleanup'! |
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
139 |
|
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
140 |
lowSpaceCleanup |
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
141 |
RecentlyUsedZipArchives := nil |
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
142 |
|
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
143 |
"Created: / 6.4.1998 / 12:36:37 / cg" |
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
144 |
! ! |
33fcaf60afa3
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
628
diff
changeset
|
145 |
|
622 | 146 |
!ZipArchive class methodsFor:'constants'! |
147 |
||
148 |
LREC_SIZE |
|
149 |
^ LREC_SIZE |
|
150 |
||
151 |
"Created: / 29.3.1998 / 19:11:20 / cg" |
|
152 |
! ! |
|
153 |
||
154 |
!ZipArchive methodsFor:'accessing'! |
|
155 |
||
156 |
entries |
|
157 |
"return a collection of fileName entries" |
|
158 |
||
159 |
|names| |
|
160 |
||
161 |
names := OrderedCollection new. |
|
162 |
||
163 |
self zipMembersDo:[:zipd | |
|
164 |
names add:(zipd name) |
|
165 |
]. |
|
166 |
^ names |
|
167 |
||
168 |
" |
|
169 |
(ZipArchive oldFileNamed:'/usr/lib/java/lib/classes.zip') entries |
|
170 |
" |
|
171 |
||
172 |
"Modified: / 29.3.1998 / 20:08:38 / cg" |
|
173 |
! |
|
174 |
||
175 |
extract:fileName |
|
176 |
|zmemb rawContents| |
|
177 |
||
178 |
zmemb := self findMember:fileName. |
|
625 | 179 |
zmemb isNil ifTrue:[^ nil]. |
180 |
||
181 |
self openFile. |
|
622 | 182 |
file position:(zmemb fileStart + 1). |
183 |
rawContents := file nextBytes:(zmemb compressed_size). |
|
625 | 184 |
self closeFile. |
622 | 185 |
^ self decode:rawContents method:(zmemb compression_method) |
186 |
||
187 |
" |
|
188 |
(ZipArchive oldFileNamed:'/usr/lib/java/lib/classes.zip') extract:'java/io/UTFDataFormatException.class' |
|
189 |
" |
|
190 |
||
625 | 191 |
"Modified: / 30.3.1998 / 18:20:08 / cg" |
622 | 192 |
! |
193 |
||
194 |
members |
|
195 |
"return a collection of members" |
|
196 |
||
197 |
|members| |
|
198 |
||
199 |
members := OrderedCollection new. |
|
200 |
||
201 |
self zipMembersDo:[:zipd | |
|
202 |
members add:zipd |
|
203 |
]. |
|
204 |
^ members |
|
205 |
||
206 |
" |
|
207 |
(ZipArchive oldFileNamed:'/usr/lib/java/lib/classes.zip') members |
|
208 |
" |
|
209 |
||
210 |
"Created: / 29.3.1998 / 20:09:27 / cg" |
|
211 |
"Modified: / 29.3.1998 / 20:10:21 / cg" |
|
628
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
212 |
! |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
213 |
|
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
214 |
name |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
215 |
^ archiveName |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
216 |
|
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
217 |
"Created: / 6.4.1998 / 10:47:11 / cg" |
622 | 218 |
! ! |
219 |
||
220 |
!ZipArchive methodsFor:'private'! |
|
221 |
||
625 | 222 |
closeFile |
223 |
file close. |
|
224 |
file := nil. |
|
225 |
||
226 |
"Created: / 30.3.1998 / 18:18:10 / cg" |
|
227 |
! |
|
228 |
||
624 | 229 |
name:nm mode:m |
625 | 230 |
archiveName := nm asFilename name. |
624 | 231 |
mode := m. |
232 |
||
622 | 233 |
mode == #read ifTrue:[ |
625 | 234 |
self openFile. |
622 | 235 |
self readDirectory. |
625 | 236 |
self closeFile. |
622 | 237 |
] ifFalse:[ |
625 | 238 |
"/ self openFile. |
622 | 239 |
] |
240 |
||
241 |
" |
|
242 |
ZipArchive oldFileNamed:'/usr/lib/java/lib/classes.zip' |
|
243 |
(ZipArchive oldFileNamed:'/usr/lib/java/lib/classes.zip') entries |
|
244 |
(ZipArchive oldFileNamed:'/usr/lib/java/lib/classes.zip') extract:'java/io/UTFDataFormatException.class' |
|
245 |
" |
|
246 |
||
625 | 247 |
"Modified: / 30.3.1998 / 18:19:48 / cg" |
248 |
! |
|
249 |
||
250 |
openFile |
|
251 |
file isNil ifTrue:[ |
|
252 |
mode == #read ifTrue:[ |
|
253 |
file := archiveName asFilename readStream binary. |
|
254 |
] ifFalse:[ |
|
255 |
file := archiveName asFilename writeStream binary |
|
256 |
] |
|
257 |
]. |
|
258 |
||
259 |
"Created: / 30.3.1998 / 18:18:48 / cg" |
|
260 |
"Modified: / 30.3.1998 / 18:19:26 / cg" |
|
622 | 261 |
! ! |
262 |
||
263 |
!ZipArchive methodsFor:'private - decompression'! |
|
264 |
||
265 |
decode:rawBytes method:compressionMethod |
|
266 |
compressionMethod == COMPR_STORED ifTrue:[ |
|
267 |
"/ uncompressed |
|
268 |
^ rawBytes |
|
269 |
]. |
|
270 |
||
271 |
compressionMethod == COMPR_SHRUNK ifTrue:[ |
|
272 |
self error:'unsupported compression method: SHRUNK'. |
|
273 |
^ nil |
|
274 |
]. |
|
275 |
compressionMethod == COMPR_REDUCED1 ifTrue:[ |
|
276 |
self error:'unsupported compression method: REDUCED1'. |
|
277 |
^ nil |
|
278 |
]. |
|
279 |
compressionMethod == COMPR_REDUCED2 ifTrue:[ |
|
280 |
self error:'unsupported compression method: REDUCED2'. |
|
281 |
^ nil |
|
282 |
]. |
|
283 |
compressionMethod == COMPR_REDUCED3 ifTrue:[ |
|
284 |
self error:'unsupported compression method: REDUCED3'. |
|
285 |
^ nil |
|
286 |
]. |
|
287 |
compressionMethod == COMPR_REDUCED4 ifTrue:[ |
|
288 |
self error:'unsupported compression method: REDUCED4'. |
|
289 |
^ nil |
|
290 |
]. |
|
291 |
compressionMethod == COMPR_IMPLODED ifTrue:[ |
|
292 |
self error:'unsupported compression method: IMPLODED'. |
|
293 |
^ nil |
|
294 |
]. |
|
295 |
compressionMethod == COMPR_TOKENIZED ifTrue:[ |
|
296 |
self error:'unsupported compression method: TOKENIZED'. |
|
297 |
^ nil |
|
298 |
]. |
|
299 |
compressionMethod == COMPR_DEFLATED ifTrue:[ |
|
300 |
self error:'unsupported compression method: DEFLATED'. |
|
301 |
^ nil |
|
302 |
]. |
|
303 |
||
304 |
self error:'unsupported compression method'. |
|
305 |
^ nil |
|
306 |
||
307 |
"Created: / 29.3.1998 / 20:14:45 / cg" |
|
308 |
"Modified: / 29.3.1998 / 20:20:20 / cg" |
|
309 |
! ! |
|
310 |
||
311 |
!ZipArchive methodsFor:'private - directory stuff'! |
|
312 |
||
313 |
addMember |
|
624 | 314 |
"add a zipMember" |
315 |
||
622 | 316 |
|zmemb | |
317 |
||
318 |
zmemb := ZipMember new. |
|
319 |
(firstEntry == nil) ifTrue:[ |
|
320 |
firstEntry := zmemb |
|
321 |
] ifFalse:[ |
|
322 |
lastEntry next:zmemb. |
|
323 |
]. |
|
324 |
lastEntry := zmemb. |
|
325 |
^ zmemb. |
|
326 |
||
327 |
"Created: / 29.3.1998 / 18:22:25 / cg" |
|
624 | 328 |
"Modified: / 30.3.1998 / 17:13:20 / cg" |
622 | 329 |
! |
330 |
||
331 |
findMember:name |
|
624 | 332 |
"find a zipMember by name" |
333 |
||
622 | 334 |
self zipMembersDo:[:zipd | |
335 |
(zipd name = name) ifTrue:[^ zipd]. |
|
336 |
]. |
|
337 |
^ nil |
|
338 |
||
624 | 339 |
"Modified: / 30.3.1998 / 17:13:30 / cg" |
622 | 340 |
! |
341 |
||
342 |
readDirectory |
|
624 | 343 |
"read the zip directory into a linked-list of zipMembers" |
344 |
||
622 | 345 |
|size count_in dir_size| |
346 |
||
347 |
size := file fileSize. |
|
348 |
(size == 0) ifTrue:[ |
|
349 |
count_in := 0. |
|
350 |
^ self |
|
351 |
]. |
|
352 |
||
353 |
(size < (ECREC_SIZE+4)) ifTrue:[ |
|
354 |
^ ZipFileFormatErrorSignal raiseWith:'zipfile too short'. |
|
355 |
]. |
|
356 |
||
357 |
file position:(size - (ECREC_SIZE+4) + 1). |
|
625 | 358 |
((file next ~~ ($P asciiValue)) |
359 |
or:[file next ~~ ($K asciiValue) |
|
360 |
or:[file next ~~ 8r005 |
|
361 |
or:[file next ~~ 8r006]]]) ifTrue:[ |
|
622 | 362 |
^ ZipFileFormatErrorSignal raiseWith:'not a valid zipfile'. |
363 |
]. |
|
364 |
||
365 |
file skip: (TOTAL_ENTRIES_CENTRAL_DIR - 4). |
|
366 |
||
624 | 367 |
count_in := file nextUnsignedShortMSB:false. "/ Get TOTAL_ENTRIES_CENTRAL_DIR |
368 |
dir_size := file nextLongMSB:false. "/ Get SIZE_CENTRAL_DIRECTORY |
|
622 | 369 |
file position:(size - (dir_size + ECREC_SIZE+4) + 1). |
370 |
||
371 |
0 to:(count_in-1) do:[:i | |
|
372 |
|zipd filename_length| |
|
373 |
||
374 |
zipd := self addMember. |
|
375 |
file skip:(4+C_COMPRESSED_SIZE-4-2-2-2). |
|
624 | 376 |
zipd compression_method:(file nextUnsignedShortMSB:false). "/ Get compression method |
377 |
(file nextUnsignedShortMSB:false). "/ skip last_mod_file_time |
|
378 |
(file nextUnsignedShortMSB:false). "/ skip last_mod_file_date |
|
379 |
zipd crc32:(file nextLongMSB:false). "/ Get crc32 |
|
380 |
zipd compressed_size:(file nextLongMSB:false). "/ Get C_COMPRESSED_SIZE |
|
381 |
zipd uncompressed_size:(file nextLongMSB:false). "/ Get C_UNCOMPRESSED_SIZE |
|
382 |
filename_length := (file nextUnsignedShortMSB:false). "/ Get C_FILENAME_LENGTH |
|
622 | 383 |
file skip:(C_RELATIVE_OFFSET_LOCAL_HEADER-(C_FILENAME_LENGTH+2)). |
624 | 384 |
zipd relative_offset_local_header:(file nextLongMSB:false). |
622 | 385 |
zipd name:(String new:filename_length). |
386 |
file nextBytes:filename_length into:(zipd name). |
|
387 |
] |
|
388 |
||
625 | 389 |
"Modified: / 30.3.1998 / 18:02:06 / cg" |
622 | 390 |
! |
391 |
||
392 |
zipMembersDo:aBlock |
|
624 | 393 |
"evaluate aBlock for all zipMembers" |
394 |
||
622 | 395 |
|zipd| |
396 |
||
397 |
zipd := firstEntry. |
|
398 |
[zipd notNil] whileTrue:[ |
|
399 |
aBlock value:zipd. |
|
400 |
zipd := zipd next |
|
401 |
]. |
|
402 |
||
403 |
"Created: / 29.3.1998 / 19:15:15 / cg" |
|
624 | 404 |
"Modified: / 30.3.1998 / 17:13:47 / cg" |
622 | 405 |
! ! |
406 |
||
407 |
!ZipArchive::ZipMember methodsFor:'accessing'! |
|
408 |
||
409 |
compressed_size |
|
410 |
"return the value of the instance variable 'compressed_size' (automatically generated)" |
|
411 |
||
412 |
^ compressed_size |
|
413 |
||
414 |
"Created: / 29.3.1998 / 18:28:03 / cg" |
|
415 |
! |
|
416 |
||
417 |
compressed_size:something |
|
418 |
"set the value of the instance variable 'compressed_size' (automatically generated)" |
|
419 |
||
420 |
compressed_size := something. |
|
421 |
||
422 |
"Created: / 29.3.1998 / 18:28:03 / cg" |
|
423 |
! |
|
424 |
||
425 |
compression_method |
|
426 |
"return the value of the instance variable 'compression_method' (automatically generated)" |
|
427 |
||
428 |
^ compression_method |
|
429 |
||
430 |
"Created: / 29.3.1998 / 20:02:57 / cg" |
|
431 |
! |
|
432 |
||
433 |
compression_method:something |
|
434 |
"set the value of the instance variable 'compression_method' (automatically generated)" |
|
435 |
||
436 |
compression_method := something. |
|
437 |
||
438 |
"Created: / 29.3.1998 / 20:02:57 / cg" |
|
439 |
! |
|
440 |
||
441 |
crc32 |
|
442 |
"return the value of the instance variable 'crc32' (automatically generated)" |
|
443 |
||
444 |
^ crc32 |
|
445 |
||
446 |
"Created: / 29.3.1998 / 20:03:00 / cg" |
|
447 |
! |
|
448 |
||
449 |
crc32:something |
|
450 |
"set the value of the instance variable 'crc32' (automatically generated)" |
|
451 |
||
452 |
crc32 := something. |
|
453 |
||
454 |
"Created: / 29.3.1998 / 20:03:00 / cg" |
|
455 |
! |
|
456 |
||
457 |
name |
|
458 |
"return the value of the instance variable 'name' (automatically generated)" |
|
459 |
||
460 |
^ name |
|
461 |
||
462 |
"Created: / 29.3.1998 / 18:29:22 / cg" |
|
463 |
! |
|
464 |
||
465 |
name:something |
|
466 |
"set the value of the instance variable 'name' (automatically generated)" |
|
467 |
||
468 |
name := something. |
|
469 |
||
470 |
"Created: / 29.3.1998 / 18:29:22 / cg" |
|
471 |
! |
|
472 |
||
473 |
next |
|
474 |
"return the value of the instance variable 'next' (automatically generated)" |
|
475 |
||
476 |
^ next |
|
477 |
||
478 |
"Created: / 29.3.1998 / 18:29:42 / cg" |
|
479 |
! |
|
480 |
||
481 |
next:something |
|
482 |
"set the value of the instance variable 'next' (automatically generated)" |
|
483 |
||
484 |
next := something. |
|
485 |
||
486 |
"Created: / 29.3.1998 / 18:29:42 / cg" |
|
487 |
! |
|
488 |
||
489 |
relative_offset_local_header |
|
490 |
"return the value of the instance variable 'relative_offset_local_header' (automatically generated)" |
|
491 |
||
492 |
^ relative_offset_local_header |
|
493 |
||
494 |
"Created: / 29.3.1998 / 18:28:40 / cg" |
|
495 |
! |
|
496 |
||
497 |
relative_offset_local_header:something |
|
498 |
"set the value of the instance variable 'relative_offset_local_header' (automatically generated)" |
|
499 |
||
500 |
relative_offset_local_header := something. |
|
501 |
||
502 |
"Created: / 29.3.1998 / 18:28:40 / cg" |
|
503 |
! |
|
504 |
||
505 |
uncompressed_size |
|
506 |
"return the value of the instance variable 'uncompressed_size' (automatically generated)" |
|
507 |
||
508 |
^ uncompressed_size |
|
509 |
||
510 |
"Created: / 29.3.1998 / 18:28:21 / cg" |
|
511 |
! |
|
512 |
||
513 |
uncompressed_size:something |
|
514 |
"set the value of the instance variable 'uncompressed_size' (automatically generated)" |
|
515 |
||
516 |
uncompressed_size := something. |
|
517 |
||
518 |
"Created: / 29.3.1998 / 18:28:21 / cg" |
|
519 |
! ! |
|
520 |
||
521 |
!ZipArchive::ZipMember methodsFor:'printing & storing'! |
|
522 |
||
523 |
displayString |
|
634 | 524 |
^ 'ZipMember(' , (name ? '*nil*') , ')' |
622 | 525 |
|
526 |
"Created: / 29.3.1998 / 20:10:07 / cg" |
|
634 | 527 |
"Modified: / 2.4.1998 / 15:10:08 / cg" |
622 | 528 |
! ! |
529 |
||
530 |
!ZipArchive::ZipMember methodsFor:'queries'! |
|
531 |
||
532 |
fileStart |
|
533 |
^ relative_offset_local_header + ZipArchive LREC_SIZE + 4 + name size |
|
534 |
||
535 |
"Created: / 29.3.1998 / 19:10:57 / cg" |
|
536 |
! ! |
|
537 |
||
628
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
538 |
!ZipArchive class methodsFor:'documentation'! |
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
539 |
|
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
540 |
version |
634 | 541 |
^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.7 1998-04-07 13:09:42 cg Exp $' |
628
27102a6bd3f7
remember recently visited zipArchives for faster access
Claus Gittinger <cg@exept.de>
parents:
625
diff
changeset
|
542 |
! ! |
622 | 543 |
ZipArchive initialize! |