--- a/PositionableStream.st Sat Aug 10 13:22:40 2013 +0200
+++ b/PositionableStream.st Sat Aug 10 13:23:45 2013 +0200
@@ -230,34 +230,37 @@
!
position
- "return the read position"
-
- ^ self position0Based
-!
-
-position0Based
- "return the read position 0-based"
+ "return the read position (0-based)"
^ position
!
+position0Based
+ <resource: #obsolete>
+ "return the read position 0-based"
+
+ ^ self position
+!
+
position0Based:index0Based
+ <resource: #obsolete>
"set the read (or write) position"
- ((index0Based > readLimit) or:[index0Based < 0]) ifTrue: [^ self positionError:index0Based].
- position := index0Based
+ self position:index0Based
!
position1Based
+ <resource: #obsolete>
"return the read position 1-based"
- ^ self position0Based + 1
+ ^ self position + 1
!
position1Based:index1Based
+ <resource: #obsolete>
"set the read (or write) position"
- self position0Based:(index1Based - 1)
+ self position:(index1Based - 1)
"
|s|
@@ -289,39 +292,11 @@
"
!
-position:newPos
+position:index0Based
"set the read (or write) position"
- ^ self position0Based:newPos
-
- "
- |s|
-
- s := '1234567890' readStream.
- s next:5.
- s position:1.
- s next:7.
- "
-
- "
- |s|
-
- s := '' writeStream.
- s nextPutAll:'1234567890'.
- s position:5.
- s nextPutAll:'abcdefg'.
- s contents
- "
-
- "
- |s|
-
- s := '' writeStream.
- s nextPutAll:'1234567890'.
- s position:0.
- s nextPutAll:'abcdefg'.
- s contents
- "
+ ((index0Based > readLimit) or:[index0Based < 0]) ifTrue: [^ self positionError:index0Based].
+ position := index0Based
!
reset
@@ -659,11 +634,11 @@
!PositionableStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.159 2013-06-03 18:39:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.160 2013-08-10 11:23:45 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.159 2013-06-03 18:39:54 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.160 2013-08-10 11:23:45 stefan Exp $'
! !