Stream.st
changeset 820 6d934f5d6cbc
parent 743 8d31a7568e44
child 846 4117b296633d
equal deleted inserted replaced
819:f17cddc493f4 820:6d934f5d6cbc
    10  hereby transferred.
    10  hereby transferred.
    11 "
    11 "
    12 
    12 
    13 Object subclass:#Stream
    13 Object subclass:#Stream
    14 	instanceVariableNames:''
    14 	instanceVariableNames:''
    15 	classVariableNames:'StreamErrorSignal PositionErrorSignal'
    15 	classVariableNames:'StreamErrorSignal PositionErrorSignal ReadErrorSignal WriteErrorSignal'
    16 	poolDictionaries:''
    16 	poolDictionaries:''
    17 	category:'Streams'
    17 	category:'Streams'
    18 !
    18 !
    19 
    19 
    20 !Stream class methodsFor:'documentation'!
    20 !Stream class methodsFor:'documentation'!
    46 	#isReadable
    46 	#isReadable
    47 	#isWritable
    47 	#isWritable
    48 
    48 
    49     Class variables:
    49     Class variables:
    50 	StreamErrorSignal       <Signal>        parent of all stream errors
    50 	StreamErrorSignal       <Signal>        parent of all stream errors
       
    51 
    51 	PositionErrorSignal     <Signal>        position attemted on a stream
    52 	PositionErrorSignal     <Signal>        position attemted on a stream
    52 						which does not support positioning
    53 						which does not support positioning
       
    54 
       
    55 	ReadErrorSignal         <Signal>        raised on read errors
       
    56 
       
    57 	WriteErrorSignal        <Signal>        raised on write errors
    53 "
    58 "
    54 ! !
    59 ! !
    55 
    60 
    56 !Stream class methodsFor:'initialization'!
    61 !Stream class methodsFor:'initialization'!
    57 
    62 
    62 	StreamErrorSignal notifierString:'Stream error'.
    67 	StreamErrorSignal notifierString:'Stream error'.
    63 
    68 
    64 	PositionErrorSignal := StreamErrorSignal newSignalMayProceed:true.
    69 	PositionErrorSignal := StreamErrorSignal newSignalMayProceed:true.
    65 	PositionErrorSignal nameClass:self message:#positionErrorSignal.
    70 	PositionErrorSignal nameClass:self message:#positionErrorSignal.
    66 	PositionErrorSignal notifierString:'stream as no concept of a position'.
    71 	PositionErrorSignal notifierString:'stream as no concept of a position'.
       
    72 
       
    73 	ReadErrorSignal := StreamErrorSignal newSignalMayProceed:false.
       
    74 	ReadErrorSignal nameClass:self message:#readErrorSignal.
       
    75 	ReadErrorSignal notifierString:'read error'.
       
    76 
       
    77 	WriteErrorSignal := StreamErrorSignal newSignalMayProceed:false.
       
    78 	WriteErrorSignal nameClass:self message:#writeErrorSignal.
       
    79 	WriteErrorSignal notifierString:'write error'.
    67     ]
    80     ]
    68 ! !
    81 ! !
    69 
    82 
    70 !Stream class methodsFor:'instance creation'!
    83 !Stream class methodsFor:'instance creation'!
    71 
    84 
    80 positionErrorSignal
    93 positionErrorSignal
    81     "return the signal raised if positioning is requested for
    94     "return the signal raised if positioning is requested for
    82      a stream which does not support that kind of operation"
    95      a stream which does not support that kind of operation"
    83 
    96 
    84     ^ PositionErrorSignal
    97     ^ PositionErrorSignal
       
    98 !
       
    99 
       
   100 readErrorSignal
       
   101     "return the signal raised on read errors"
       
   102 
       
   103     ^ ReadErrorSignal
    85 !
   104 !
    86 
   105 
    87 streamErrorSignal
   106 streamErrorSignal
    88     "return the parent of all stream errors;
   107     "return the parent of all stream errors;
    89      handling this one also handles all other errors.
   108      handling this one also handles all other errors.
    90      Also, this one may be raised for errors not related to read/write
   109      Also, this one may be raised for errors not related to read/write
    91      operations, such as failed ioctls in externalStream etc."
   110      operations, such as failed ioctls in externalStream etc."
    92 
   111 
    93     ^ StreamErrorSignal
   112     ^ StreamErrorSignal
       
   113 !
       
   114 
       
   115 writeErrorSignal
       
   116     "return the signal raised on write errors"
       
   117 
       
   118     ^ WriteErrorSignal
    94 ! !
   119 ! !
    95 
   120 
    96 !Stream methodsFor:'accessing'!
   121 !Stream methodsFor:'accessing'!
    97 
   122 
    98 contents
   123 contents
   897 ! !
   922 ! !
   898 
   923 
   899 !Stream class methodsFor:'documentation'!
   924 !Stream class methodsFor:'documentation'!
   900 
   925 
   901 version
   926 version
   902     ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.30 1995-12-13 10:27:04 cg Exp $'
   927     ^ '$Header: /cvs/stx/stx/libbasic/Stream.st,v 1.31 1995-12-23 19:04:38 cg Exp $'
   903 ! !
   928 ! !
   904 Stream initialize!
   929 Stream initialize!