PositionableStream.st
changeset 6494 5b3d8667c22a
parent 6421 58dca33cf0fc
child 6538 1828dcb8f067
equal deleted inserted replaced
6493:e1994265c512 6494:5b3d8667c22a
  1034      Return everything read excluding the elements in aCollection.
  1034      Return everything read excluding the elements in aCollection.
  1035      The position is left before the collection; i.e. the next
  1035      The position is left before the collection; i.e. the next
  1036      read operations will return those elements.
  1036      read operations will return those elements.
  1037      If no such subcollection is encountered, all elements up to the end 
  1037      If no such subcollection is encountered, all elements up to the end 
  1038      are read and returned.
  1038      are read and returned.
  1039      Compare this with #throughAll: which also reads up to some objects
  1039      See also #throughAll: which also reads up to some objects
  1040      but positions behind it and DOES include it in the returned
  1040      but positions behind it and DOES include it in the returned
  1041      collection.
  1041      collection.
       
  1042      See also #upToAllExcluding:, which returns the same, but leaves the
       
  1043      read pointer after the matched subcollection.
  1042 
  1044 
  1043      Note: this behavior is inconsistent with the other upTo.. methods,
  1045      Note: this behavior is inconsistent with the other upTo.. methods,
  1044            which position after the found item. We implement the method
  1046            which position after the found item. We implement the method
  1045            this way for the sake of ST80-compatibility."
  1047            this way for the sake of ST80-compatibility."
  1046 
  1048 
  1062 
  1064 
  1063     "
  1065     "
  1064      |s|
  1066      |s|
  1065      s := ReadStream on:'hello world'.
  1067      s := ReadStream on:'hello world'.
  1066      Transcript show:'<'; show:(s upToAll:'wo'); showCR:'>'. 
  1068      Transcript show:'<'; show:(s upToAll:'wo'); showCR:'>'. 
       
  1069      Transcript showCR:s atEnd.
  1067      Transcript show:'<'; show:(s upToEnd); showCR:'>'. 
  1070      Transcript show:'<'; show:(s upToEnd); showCR:'>'. 
  1068     "
  1071     "
  1069     "
  1072     "
  1070      |s|
  1073      |s|
  1071      s := ReadStream on:'hello world'.
  1074      s := ReadStream on:'hello world'.
  1093 ! !
  1096 ! !
  1094 
  1097 
  1095 !PositionableStream class methodsFor:'documentation'!
  1098 !PositionableStream class methodsFor:'documentation'!
  1096 
  1099 
  1097 version
  1100 version
  1098     ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.109 2002-02-26 13:01:37 cg Exp $'
  1101     ^ '$Header: /cvs/stx/stx/libbasic/PositionableStream.st,v 1.110 2002-04-11 09:26:07 cg Exp $'
  1099 ! !
  1102 ! !
  1100 PositionableStream initialize!
  1103 PositionableStream initialize!