--- a/LineNumberReadStream.st Fri Feb 18 15:40:57 2000 +0100
+++ b/LineNumberReadStream.st Thu Mar 02 15:15:13 2000 +0100
@@ -1,6 +1,8 @@
+"{ Package: 'stx:goodies' }"
+
"
COPYRIGHT (c) 1996 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -24,7 +26,7 @@
copyright
"
COPYRIGHT (c) 1996 by eXept Software AG
- All Rights Reserved
+ All Rights Reserved
This software is furnished under a license and may be used
only in accordance with the terms of that license and with the
@@ -46,18 +48,18 @@
input stream, and let it keep track of the lineNumber.
[see also:]
- ReadStream WriteStream ExternalStream FileStream
- FilteringStream FilteringLineStream
+ ReadStream WriteStream ExternalStream FileStream
+ FilteringStream FilteringLineStream
[author:]
- Claus Gittinger
+ Claus Gittinger
"
!
examples
"
count lines in a Makefile:
- [exBegin]
+ [exBegin]
|in filter|
in := 'Makefile' asFilename readStream.
@@ -68,12 +70,12 @@
filter close.
Transcript showCR:('Makefile has %1 lines' bindWith:(filter lineNumber - 1)).
- [exEnd]
+ [exEnd]
find a specific string and output its lineNr:
- [exBegin]
+ [exBegin]
|in filter|
in := 'Makefile' asFilename readStream.
@@ -84,7 +86,7 @@
filter close.
Transcript showCR:('found in line %1' bindWith:(filter lineNumber)).
- [exEnd]
+ [exEnd]
"
@@ -118,11 +120,11 @@
lineNumber := 1.
filter := [:char |
- char == Character cr ifTrue:[
- lineNumber := lineNumber + 1.
- ].
- char
- ].
+ char == Character cr ifTrue:[
+ lineNumber := lineNumber + 1.
+ ].
+ char
+ ].
"Modified: 11.1.1997 / 16:58:42 / cg"
! !
@@ -130,5 +132,5 @@
!LineNumberReadStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/LineNumberReadStream.st,v 1.1 1997-01-11 18:54:37 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/LineNumberReadStream.st,v 1.2 2000-03-02 14:14:53 cg Exp $'
! !