--- a/NPExtStr.st Mon Sep 22 21:02:08 1997 +0200
+++ b/NPExtStr.st Mon Sep 22 21:04:17 1997 +0200
@@ -68,6 +68,8 @@
!NonPositionableExternalStream class methodsFor:'instance creation'!
forStderr
+ "{ Pragma: +optSpace }"
+
"return a NonPositionableExternalStream object for writing to
Unixes standard error output file descriptor"
@@ -78,6 +80,8 @@
!
forStdin
+ "{ Pragma: +optSpace }"
+
"return a NonPositionableExternalStream object for reading from
Unixes standard input file descriptor"
@@ -88,6 +92,8 @@
!
forStdout
+ "{ Pragma: +optSpace }"
+
"return a NonPositionableExternalStream object for writing to
Unixes standard output file descriptor"
@@ -100,6 +106,8 @@
!NonPositionableExternalStream methodsFor:'error handling'!
positionError
+ "{ Pragma: +optSpace }"
+
"notify that this stream has no concept of a position"
^ PositionErrorSignal raiseRequestWith:self in:thisContext sender
@@ -108,12 +116,16 @@
!NonPositionableExternalStream methodsFor:'positioning'!
position
+ "{ Pragma: +optSpace }"
+
"catch position - there is none here"
^ self positionError
!
position:aPosition
+ "{ Pragma: +optSpace }"
+
"catch position - there is none here"
^ self positionError
@@ -132,24 +144,34 @@
!NonPositionableExternalStream methodsFor:'printing & storing'!
printOn:aStream
+ "{ Pragma: +optSpace }"
+
"append a printed representation of the receiver on aStream"
+ |myName|
+
self == Stdin ifTrue:[
- aStream nextPutAll:'Stdin'.
- ^ self
+ myName := 'Stdin'.
+ ] ifFalse:[
+ self == Stdout ifTrue:[
+ myName := 'Stdout'.
+ ] ifFalse:[
+ self == Stderr ifTrue:[
+ myName := 'Stderr'.
+ ]
+ ]
].
- self == Stdout ifTrue:[
- aStream nextPutAll:'Stdout'.
- ^ self
- ].
- self == Stderr ifTrue:[
- aStream nextPutAll:'Stderr'.
+
+ myName notNil ifTrue:[
+ aStream nextPutAll:myName.
^ self
].
super printOn:aStream
!
storeOn:aStream
+ "{ Pragma: +optSpace }"
+
"append a printed representation of the receiver on aStream, from
which the receiver can be reconstructed."
@@ -164,6 +186,8 @@
!NonPositionableExternalStream methodsFor:'private'!
initializeForStderr
+ "{ Pragma: +optSpace }"
+
"setup for writing to stderr"
mode := #readwrite.
@@ -176,6 +200,8 @@
!
initializeForStdin
+ "{ Pragma: +optSpace }"
+
"setup for reading stdin"
mode := #readonly.
@@ -188,6 +214,8 @@
!
initializeForStdout
+ "{ Pragma: +optSpace }"
+
"setup for writing to stdout"
mode := #readwrite.
@@ -200,6 +228,8 @@
!
reOpen
+ "{ Pragma: +optSpace }"
+
"reopen the stream after an image restart.
If I am one of the standard streams, reopen is easy"
@@ -226,5 +256,5 @@
!NonPositionableExternalStream class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Attic/NPExtStr.st,v 1.29 1997-09-04 21:02:52 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Attic/NPExtStr.st,v 1.30 1997-09-22 19:04:17 cg Exp $'
! !