class: ZipArchive
authorStefan Vogel <sv@exept.de>
Sat, 10 Aug 2013 13:08:57 +0200
changeset 3078 ee1225437bfe
parent 3077 032905ddd57a
child 3079 a419a95f3e3f
class: ZipArchive changed:9 methods use #position/#position: instead of #positionXBased
ZipArchive.st
--- a/ZipArchive.st	Fri Aug 09 16:40:47 2013 +0200
+++ b/ZipArchive.st	Sat Aug 10 13:08:57 2013 +0200
@@ -3297,7 +3297,7 @@
                 maxStartPosition := members maxApplying:[:eachMember | self dataStartOf:eachMember].
                 lastMember := members detect:[:eachMember | eachMember dataStart = maxStartPosition].
 
-                file position0Based:(startOfArchive + lastMember dataStart + lastMember compressedSize).
+                file position:(startOfArchive + lastMember dataStart + lastMember compressedSize).
                 mode := #write.
             ].
         ] ensure:[
@@ -3437,7 +3437,7 @@
            the central directory entry!!
     "
 
-    file position0Based:fileHeaderStart+26.
+    file position:fileHeaderStart+26.
     fileNameLength := file nextUnsignedShortMSB:false.
     extraFieldLength := file nextUnsignedShortMSB:false.
 
@@ -3799,7 +3799,7 @@
     ].
 
     "/ position before end of central directory signature
-    pos0 := file position0Based - 4.
+    pos0 := file position - 4.
 
     "/ Now we have found the end of central directory record
     centralDirectory := ZipCentralDirectory new.
@@ -3816,7 +3816,7 @@
         ].
 
         startOfArchive := pos0 - centralDirectory centralDirectoryStartOffset - centralDirectory centralDirectorySize.
-        file position0Based:(pos0 - (centralDirectory centralDirectorySize)).
+        file position:(pos0 - (centralDirectory centralDirectorySize)).
 
         zipMembersByName := Dictionary new:centralDirectory centralDirectoryTotalNoOfEntries.
 
@@ -3869,7 +3869,7 @@
 
     foundPK := false.
     size := endOfArchive - startOfArchive.
-    file position0Based:(pos0 := endOfArchive - ECREC_SIZE - 4).
+    file position:(pos0 := endOfArchive - ECREC_SIZE - 4).
 
     "/ set position to end of central directory record
     ((file nextByte ~~ ($P codePoint))
@@ -3888,7 +3888,7 @@
             searchEndPos := startOfArchive.
         ].
 
-        file position0Based: (pos0 := endOfArchive - 4).
+        file position: (pos0 := endOfArchive - 4).
 
         [foundPK] whileFalse: [
             (file nextByte == ($P codePoint)
@@ -3897,13 +3897,13 @@
             and:[file nextByte == 8r006]]]) ifTrue:[
                 ^ true                
             ].
-            file position0Based <= searchEndPos ifTrue: [
+            file position <= searchEndPos ifTrue: [
                 ^ false.
             ].
             pos0 == 0 ifTrue:[
                 ^ false.
             ].
-            file position0Based: (pos0 := pos0 - 1).
+            file position: (pos0 := pos0 - 1).
         ].
         ^ false
     ].
@@ -3948,7 +3948,7 @@
         do:[:zmemb :position |
             |rawContents data|
 
-            file position0Based:position.
+            file position:position.
             rawContents := file nextBytes:(zmemb compressedSize).
 
             data := self
@@ -3973,7 +3973,7 @@
         do:[:zmemb :position |
             |buffer rdSize nextBlockSize streamBufferSize myZipStream|
 
-            file position0Based:position.
+            file position:position.
 
             rdSize := zmemb uncompressedSize.
             streamBufferSize := self class streamBufferSize.    
@@ -4121,7 +4121,7 @@
     ].
 
     dataStart := self dataStartOf:zipEntry.
-    file position0Based:dataStart.
+    file position:dataStart.
 
     ^ (ZipReadStream zipFileStream:file zipEntry:zipEntry)
         zipArchive:self.
@@ -4235,7 +4235,7 @@
     buffer := ByteArray new:streamBufferSize.
     crc32 := 0.
     unCompressedDataSize := 0.
-    startDataPosition := file position0Based.
+    startDataPosition := file position.
 
     [
         [aStream atEnd] whileFalse: [
@@ -4262,7 +4262,7 @@
         ].
     ].
 
-    zipEntry compressedSize:(file position0Based) - startDataPosition.
+    zipEntry compressedSize:(file position) - startDataPosition.
 
     "/ crc32 is allways reqired (not as written in docu to be zero in case of uncompressed mode)
     zipEntry crc32:crc32.
@@ -4983,7 +4983,7 @@
 
     zipEntry := aZipEntry.
     zipFileStream := something.
-    startDataPosition := zipFileStream position0Based.
+    startDataPosition := zipFileStream position.
     crc32 := 0.
     uncompressedDataSize := zipEntry uncompressedSize.
     readPosition := 0.
@@ -5076,7 +5076,7 @@
     ].
     compressingStream := nil.
 
-    zipEntry compressedSize:(zipFileStream position0Based) - startDataPosition.
+    zipEntry compressedSize:(zipFileStream position) - startDataPosition.
 
     "/ crc32 is allways reqired (not as written in docu to be zero in case of uncompressed mode)
     zipEntry crc32:crc32.
@@ -5093,7 +5093,7 @@
 
     zipEntry := aZipEntry.
     zipFileStream := something.
-    startDataPosition := zipFileStream position0Based.
+    startDataPosition := zipFileStream position.
     crc32 := 0.
     uncompressedDataSize := 0.
 
@@ -5178,11 +5178,11 @@
 !ZipArchive class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.107 2013-05-17 10:06:46 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.108 2013-08-10 11:08:57 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.107 2013-05-17 10:06:46 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/ZipArchive.st,v 1.108 2013-08-10 11:08:57 stefan Exp $'
 ! !