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