author | Claus Gittinger <cg@exept.de> |
Fri, 05 Mar 2004 21:00:26 +0100 | |
changeset 8098 | 8d1d5cd8529b |
parent 7483 | 471b86450ede |
child 8140 | 7cc7ac5f29ca |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
202 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
5810 | 13 |
"{ Package: 'stx:libbasic' }" |
14 |
||
1 | 15 |
PositionableStream subclass:#ReadStream |
970
3b59c9b38dbb
ST80 compatibility: generate signal at end of stream when instance variable
Stefan Vogel <sv@exept.de>
parents:
829
diff
changeset
|
16 |
instanceVariableNames:'' |
3b59c9b38dbb
ST80 compatibility: generate signal at end of stream when instance variable
Stefan Vogel <sv@exept.de>
parents:
829
diff
changeset
|
17 |
classVariableNames:'' |
3b59c9b38dbb
ST80 compatibility: generate signal at end of stream when instance variable
Stefan Vogel <sv@exept.de>
parents:
829
diff
changeset
|
18 |
poolDictionaries:'' |
3b59c9b38dbb
ST80 compatibility: generate signal at end of stream when instance variable
Stefan Vogel <sv@exept.de>
parents:
829
diff
changeset
|
19 |
category:'Streams' |
1 | 20 |
! |
21 |
||
2162
7e1601f633b6
ff is a separator too (in #skipSeparators*)
Claus Gittinger <cg@exept.de>
parents:
1688
diff
changeset
|
22 |
!ReadStream class methodsFor:'documentation'! |
88 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1988 by Claus Gittinger |
|
202 | 27 |
All Rights Reserved |
1 | 28 |
|
88 | 29 |
This software is furnished under a license and may be used |
30 |
only in accordance with the terms of that license and with the |
|
31 |
inclusion of the above copyright notice. This software may not |
|
32 |
be provided or otherwise made available to, or used by, any |
|
33 |
other person. No title to or ownership of the software is |
|
34 |
hereby transferred. |
|
35 |
" |
|
36 |
! |
|
1 | 37 |
|
88 | 38 |
documentation |
39 |
" |
|
40 |
ReadStream defines protocol for reading streamwise over collections. |
|
1295 | 41 |
|
42 |
[author:] |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
43 |
Claus Gittinger |
1295 | 44 |
|
88 | 45 |
" |
46 |
! ! |
|
1 | 47 |
|
202 | 48 |
!ReadStream methodsFor:'converting'! |
49 |
||
50 |
readStream |
|
51 |
"return a readStream from the receiver. Since this is already |
|
52 |
a readStream, return self." |
|
53 |
||
54 |
^ self |
|
55 |
! ! |
|
56 |
||
1400 | 57 |
!ReadStream methodsFor:'emphasis'! |
58 |
||
59 |
emphasis |
|
60 |
"return the emphasis of the current (i.e. next returned by #next) |
|
61 |
element. Streams on a string will return nil for all elements. |
|
62 |
Streams on collections which nothing at all about emphasises, |
|
63 |
will report an error." |
|
64 |
||
7114 | 65 |
^ collection emphasisAt:(position - ZeroPosition + 1). |
1400 | 66 |
|
67 |
" |
|
68 |
|t s| |
|
69 |
||
70 |
t := 'hello world' asText |
|
7114 | 71 |
emphasizeFrom:1 to:5 with:#bold; |
72 |
emphasizeFrom:7 to:11 with:#italic. |
|
1400 | 73 |
|
74 |
s := t readStream. |
|
75 |
[s atEnd] whileFalse:[ |
|
7114 | 76 |
Transcript show:(s emphasis); show:' '. |
77 |
Transcript show:''''; show:(s next); showCR:''''. |
|
1400 | 78 |
]. |
79 |
" |
|
80 |
||
81 |
"Modified: 15.5.1996 / 17:30:33 / cg" |
|
82 |
! ! |
|
83 |
||
345 | 84 |
!ReadStream methodsFor:'queries'! |
85 |
||
5310 | 86 |
copyFrom:beginning to:end |
87 |
^ collection copyFrom:beginning to:end |
|
88 |
! |
|
89 |
||
345 | 90 |
isReadable |
2997 | 91 |
"return true, if reading is supported by the recevier. |
92 |
Here, true is always returned." |
|
93 |
||
345 | 94 |
^ true |
2997 | 95 |
|
96 |
"Modified: 4.10.1997 / 17:59:21 / cg" |
|
1665
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
97 |
! |
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
98 |
|
6315 | 99 |
isWritable |
100 |
"return true, if writing is supported by the recevier. |
|
101 |
This has to be redefined in concrete subclasses." |
|
102 |
||
103 |
^ false |
|
104 |
! |
|
105 |
||
1665
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
106 |
size |
2997 | 107 |
"return the number of elements in the streamed collection." |
108 |
||
1665
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
109 |
^ collection size |
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
110 |
|
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
111 |
"Created: 13.9.1996 / 18:14:35 / cg" |
2997 | 112 |
"Modified: 4.10.1997 / 17:59:45 / cg" |
345 | 113 |
! ! |
114 |
||
59 | 115 |
!ReadStream methodsFor:'reading'! |
1 | 116 |
|
117 |
next |
|
118 |
"return the next element; advance read pointer. |
|
2 | 119 |
return nil, if there is no next element. |
345 | 120 |
- tuned for a bit more speed on String/ByteArray/Array-Streams" |
1 | 121 |
|
122 |
|ret| |
|
123 |
||
124 |
%{ /* NOCONTEXT */ |
|
125 |
||
126 |
REGISTER int pos; |
|
127 |
unsigned ch; |
|
252 | 128 |
OBJ coll, p, l; |
1 | 129 |
|
1133 | 130 |
coll = __INST(collection); |
131 |
p = __INST(position); |
|
132 |
l = __INST(readLimit); |
|
1 | 133 |
|
252 | 134 |
if (__isNonNilObject(coll) && __bothSmallInteger(p, l)) { |
135 |
||
8098
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
136 |
pos = __intVal(p); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
137 |
/* make 1-based */ |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
138 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
139 |
if (pos > 0 && pos <= __intVal(l)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
140 |
OBJ cls; |
59 | 141 |
|
8098
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
142 |
cls = __qClass(coll); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
143 |
if (cls == @global(String)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
144 |
if (pos <= __stringSize(coll)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
145 |
__INST(position) = __MKSMALLINT(__intVal(__INST(position)) + 1); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
146 |
ch = __stringVal(coll)[pos-1]; |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
147 |
RETURN ( __MKCHARACTER(ch) ); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
148 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
149 |
} else if (cls == @global(ByteArray)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
150 |
if (pos <= __byteArraySize(coll)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
151 |
__INST(position) = __MKSMALLINT(__intVal(__INST(position)) + 1); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
152 |
ch = __ByteArrayInstPtr(coll)->ba_element[pos-1]; |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
153 |
RETURN ( __MKSMALLINT(ch) ); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
154 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
155 |
} else if (cls == @global(Unicode16String)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
156 |
if (pos <= __unicode16StringSize(coll)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
157 |
__INST(position) = __MKSMALLINT(__intVal(__INST(position)) + 1); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
158 |
ch = __Unicode16StringInstPtr(coll)->s_element[pos-1]; |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
159 |
RETURN ( __MKUCHARACTER(ch) ); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
160 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
161 |
} else if (cls == @global(Array)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
162 |
if (pos <= __arraySize(coll)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
163 |
__INST(position) = __MKSMALLINT(__intVal(__INST(position)) + 1); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
164 |
RETURN ( __ArrayInstPtr(coll)->a_element[pos-1]); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
165 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
166 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
167 |
} |
1 | 168 |
} |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
169 |
%}. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
170 |
((position + 1 - ZeroPosition) > readLimit) ifTrue:[^ self pastEnd]. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
171 |
ret := collection at:(position + 1 - ZeroPosition). |
1 | 172 |
position := position + 1. |
173 |
^ ret |
|
174 |
! |
|
175 |
||
252 | 176 |
nextAlphaNumericWord |
1 | 177 |
"read the next word (i.e. up to non letter-or-digit). |
178 |
return a string containing those characters. |
|
3112
ccf7121ddae8
nextAlphaNumericWord changed
Claus Gittinger <cg@exept.de>
parents:
2997
diff
changeset
|
179 |
Skips any non-alphanumeric chars first. |
59 | 180 |
- tuned for speed on String-Streams for faster scanning" |
1 | 181 |
%{ |
182 |
/* speedup, if collection is a string */ |
|
183 |
||
184 |
int pos, limit, sz; |
|
185 |
int len; |
|
13 | 186 |
char buffer[256]; |
187 |
REGISTER unsigned char *cp; |
|
188 |
REGISTER unsigned ch; |
|
252 | 189 |
OBJ coll, p, l; |
1 | 190 |
|
1133 | 191 |
coll = __INST(collection); |
192 |
p = __INST(position); |
|
193 |
l = __INST(readLimit); |
|
252 | 194 |
|
195 |
if (__isString(coll) && __bothSmallInteger(p, l)) { |
|
196 |
||
1133 | 197 |
pos = __intVal(p); |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
198 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
199 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
200 |
|
1133 | 201 |
limit = __intVal(l); |
329 | 202 |
sz = __qSize(coll) - OHDR_SIZE; |
202 | 203 |
if (sz < limit) |
204 |
limit = sz; |
|
1133 | 205 |
cp = __stringVal(coll) + pos - 1; |
1 | 206 |
|
202 | 207 |
for (;;) { |
208 |
if (pos > limit) break; |
|
209 |
ch = *cp; |
|
1 | 210 |
|
3112
ccf7121ddae8
nextAlphaNumericWord changed
Claus Gittinger <cg@exept.de>
parents:
2997
diff
changeset
|
211 |
if (((ch >= 'a') && (ch <= 'z')) || |
ccf7121ddae8
nextAlphaNumericWord changed
Claus Gittinger <cg@exept.de>
parents:
2997
diff
changeset
|
212 |
((ch >= 'A') && (ch <= 'Z')) || |
ccf7121ddae8
nextAlphaNumericWord changed
Claus Gittinger <cg@exept.de>
parents:
2997
diff
changeset
|
213 |
((ch >= '0') && (ch <= '9'))) |
ccf7121ddae8
nextAlphaNumericWord changed
Claus Gittinger <cg@exept.de>
parents:
2997
diff
changeset
|
214 |
break; |
202 | 215 |
cp++; |
216 |
pos++; |
|
217 |
} |
|
1 | 218 |
|
202 | 219 |
len = 0; |
220 |
for (;;) { |
|
221 |
if (pos > limit) break; |
|
222 |
ch = *cp & 0xFF; |
|
1 | 223 |
|
202 | 224 |
if (! (((ch >= 'a') && (ch <= 'z')) || |
225 |
((ch >= 'A') && (ch <= 'Z')) || |
|
226 |
((ch >= '0') && (ch <= '9')))) |
|
227 |
break; |
|
228 |
buffer[len++] = ch; |
|
229 |
if (len >= (sizeof(buffer)-1)) { |
|
230 |
/* emergency */ |
|
231 |
break; |
|
232 |
} |
|
233 |
pos++; |
|
234 |
cp++; |
|
235 |
} |
|
1 | 236 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
237 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
238 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
1133 | 239 |
__INST(position) = __MKSMALLINT(pos); |
202 | 240 |
buffer[len] = '\0'; |
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1665
diff
changeset
|
241 |
RETURN ( (len != 0) ? __MKSTRING_L(buffer, len) : nil ); |
1 | 242 |
} |
243 |
%} |
|
244 |
. |
|
252 | 245 |
^ super nextAlphaNumericWord |
1 | 246 |
! |
247 |
||
1665
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
248 |
nextByte |
4826
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
249 |
"return the next element; advance read pointer. |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
250 |
return nil, if there is no next element. |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
251 |
- tuned for a bit more speed on String/ByteArray/Array-Streams" |
1665
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
252 |
|
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
253 |
|ret| |
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
254 |
|
4826
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
255 |
%{ /* NOCONTEXT */ |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
256 |
|
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
257 |
REGISTER int pos; |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
258 |
unsigned ch; |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
259 |
OBJ coll, p, l; |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
260 |
|
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
261 |
coll = __INST(collection); |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
262 |
p = __INST(position); |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
263 |
l = __INST(readLimit); |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
264 |
|
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
265 |
if (__isNonNilObject(coll) && __bothSmallInteger(p, l)) { |
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
266 |
|
8098
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
267 |
pos = __intVal(p); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
268 |
/* make 1-based */ |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
269 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
270 |
if (pos > 0 && pos <= __intVal(l)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
271 |
OBJ cls; |
4826
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
272 |
|
8098
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
273 |
cls = __qClass(coll); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
274 |
if (cls == @global(String)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
275 |
if (pos <= __stringSize(coll)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
276 |
__INST(position) = __MKSMALLINT(__intVal(__INST(position)) + 1); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
277 |
ch = __stringVal(coll)[pos-1]; |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
278 |
RETURN ( __MKSMALLINT(ch) ); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
279 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
280 |
} else if (cls == @global(ByteArray)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
281 |
if (pos <= __byteArraySize(coll)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
282 |
__INST(position) = __MKSMALLINT(__intVal(__INST(position)) + 1); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
283 |
ch = __ByteArrayInstPtr(coll)->ba_element[pos-1]; |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
284 |
RETURN ( __MKSMALLINT(ch) ); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
285 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
286 |
} else if (cls == @global(Array)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
287 |
if (pos <= __arraySize(coll)) { |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
288 |
__INST(position) = __MKSMALLINT(__intVal(__INST(position)) + 1); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
289 |
RETURN ( __ArrayInstPtr(coll)->a_element[pos-1]); |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
290 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
291 |
} |
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
292 |
} |
4826
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
293 |
} |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
294 |
%}. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
295 |
((position + 1 - ZeroPosition) > readLimit) ifTrue:[^ self pastEnd]. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
296 |
ret := collection at:(position + 1 -ZeroPosition). |
4826
ff30434f0feb
#nextByte does return an integer, even when operating on a
Claus Gittinger <cg@exept.de>
parents:
4522
diff
changeset
|
297 |
position := position + 1. |
8098
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
298 |
^ ret asInteger |
1665
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
299 |
! |
928e9a308cea
added ExternalStream compatibility protocol
Claus Gittinger <cg@exept.de>
parents:
1488
diff
changeset
|
300 |
|
611 | 301 |
nextDecimalInteger |
302 |
"read the next integer in radix 10. dont skip whitespace. |
|
303 |
- tuned for speed on String-Streams for faster scanning" |
|
304 |
||
305 |
|value nextOne| |
|
306 |
%{ |
|
307 |
int pos, limit, sz; |
|
308 |
REGISTER unsigned char *cp; |
|
309 |
REGISTER unsigned ch; |
|
310 |
int val = 0; |
|
311 |
OBJ coll, p, l; |
|
312 |
||
1133 | 313 |
coll = __INST(collection); |
314 |
p = __INST(position); |
|
315 |
l = __INST(readLimit); |
|
611 | 316 |
|
317 |
if (__isString(coll) && __bothSmallInteger(p, l)) { |
|
318 |
||
1133 | 319 |
pos = __intVal(p); |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
320 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
321 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
1133 | 322 |
limit = __intVal(l); |
611 | 323 |
sz = __qSize(coll) - OHDR_SIZE; |
324 |
if (sz < limit) |
|
325 |
limit = sz; |
|
1133 | 326 |
cp = __stringVal(coll) + pos - 1; |
611 | 327 |
|
328 |
for (;;) { |
|
329 |
if (pos > limit) break; |
|
330 |
ch = *cp; |
|
331 |
||
332 |
if ((ch < '0') || (ch > '9')) break; |
|
333 |
val = val * 10 + (ch - '0'); |
|
334 |
pos++; |
|
335 |
if (val > (_MAX_INT / 10)) goto oops; |
|
336 |
cp++; |
|
337 |
} |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
338 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
339 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
1133 | 340 |
__INST(position) = __MKSMALLINT(pos); |
4271
d1878c9dc428
oops - return instead of RETURN macro
Claus Gittinger <cg@exept.de>
parents:
3316
diff
changeset
|
341 |
RETURN (__MKSMALLINT(val)); |
611 | 342 |
} |
343 |
oops: |
|
1133 | 344 |
value = __MKSMALLINT(val); |
611 | 345 |
%} |
346 |
. |
|
347 |
"fall-back for non-string streams - we have to continue where |
|
348 |
above primitive left off, in case of a large integer ... |
|
349 |
(instead of doing a super nextDecimalInteger)" |
|
350 |
||
351 |
nextOne := self peek. |
|
352 |
[nextOne notNil and:[nextOne isDigitRadix:10]] whileTrue:[ |
|
353 |
value = (value * 10) + nextOne digitValue. |
|
354 |
nextOne := self nextPeek |
|
355 |
]. |
|
356 |
^ value |
|
357 |
! |
|
358 |
||
359 |
nextPeek |
|
360 |
"advance read pointer return the peek element. |
|
361 |
this is equivalent to (self next; peek). |
|
362 |
- tuned for speed on String-Streams for faster scanning" |
|
363 |
||
364 |
%{ /* NOCONTEXT */ |
|
365 |
OBJ coll, l, p; |
|
366 |
||
1133 | 367 |
coll = __INST(collection); |
368 |
p = __INST(position); |
|
369 |
l = __INST(readLimit); |
|
611 | 370 |
|
371 |
if (__isString(coll) && __bothSmallInteger(p, l)) { |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
372 |
REGISTER int pos; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
373 |
unsigned ch; |
611 | 374 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
375 |
pos = __intVal(p); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
376 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
377 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
378 |
if ((pos > 0) && (pos < __intVal(l)) && (pos < __stringSize(coll))) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
379 |
pos = pos + 1; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
380 |
ch = __stringVal(coll)[pos-1]; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
381 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
382 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
383 |
__INST(position) = __MKSMALLINT(pos); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
384 |
RETURN ( __MKCHARACTER(ch) ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
385 |
} |
611 | 386 |
} |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
387 |
%}. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
388 |
((position + 1 - ZeroPosition) > readLimit) ifTrue:[^ self pastEnd]. |
611 | 389 |
position := position + 1. |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
390 |
((position + 1 - ZeroPosition) > readLimit) ifTrue:[^ self pastEnd]. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
391 |
^ collection at:(position + 1 - ZeroPosition) |
611 | 392 |
! |
393 |
||
1 | 394 |
nextSymbol |
395 |
"read the next selector-symbol (i.e. up to non letter-or-digit). |
|
396 |
return a string containing those characters. |
|
59 | 397 |
- tuned for speed on String-Streams for faster scanning" |
1 | 398 |
%{ |
399 |
int pos, limit, sz; |
|
400 |
int len; |
|
13 | 401 |
char buffer[256]; |
402 |
REGISTER unsigned char *cp; |
|
403 |
REGISTER unsigned ch; |
|
252 | 404 |
OBJ coll, p, l; |
1 | 405 |
|
1133 | 406 |
coll = __INST(collection); |
407 |
p = __INST(position); |
|
408 |
l = __INST(readLimit); |
|
252 | 409 |
|
410 |
if (__isString(coll) && __bothSmallInteger(p, l)) { |
|
411 |
||
1133 | 412 |
pos = __intVal(p); |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
413 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
414 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
1133 | 415 |
limit = __intVal(l); |
329 | 416 |
sz = __qSize(coll) - OHDR_SIZE; |
202 | 417 |
if (sz < limit) |
418 |
limit = sz; |
|
1133 | 419 |
cp = __stringVal(coll) + pos - 1; |
1 | 420 |
|
202 | 421 |
len = 0; |
422 |
for (;;) { |
|
423 |
if (pos > limit) break; |
|
424 |
ch = *cp; |
|
1 | 425 |
|
202 | 426 |
if (! (((ch >= 'a') && (ch <= 'z')) || |
427 |
((ch >= 'A') && (ch <= 'Z')) || |
|
428 |
((ch >= '0') && (ch <= '9')) || |
|
429 |
(ch == ':'))) |
|
430 |
break; |
|
431 |
buffer[len++] = ch; |
|
432 |
if (len >= (sizeof(buffer)-1)) { |
|
433 |
/* emergency */ |
|
434 |
break; |
|
435 |
} |
|
436 |
pos++; |
|
437 |
cp++; |
|
438 |
} |
|
1 | 439 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
440 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
441 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
1133 | 442 |
__INST(position) = __MKSMALLINT(pos); |
202 | 443 |
buffer[len] = '\0'; |
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1665
diff
changeset
|
444 |
RETURN ( (len != 0) ? __MKSTRING_L(buffer, len) : nil ); |
1 | 445 |
} |
446 |
%} |
|
447 |
. |
|
448 |
^ super nextSymbol |
|
449 |
! |
|
450 |
||
611 | 451 |
peek |
452 |
"return the next element; do NOT advance read pointer. |
|
453 |
return nil, if there is no next element. |
|
454 |
- tuned for a bit more speed on String/ByteArray/Array-Streams" |
|
1 | 455 |
|
456 |
%{ /* NOCONTEXT */ |
|
611 | 457 |
|
458 |
REGISTER int pos; |
|
459 |
unsigned ch; |
|
460 |
OBJ coll; |
|
461 |
OBJ cls, p, l; |
|
1 | 462 |
|
1133 | 463 |
coll = __INST(collection); |
464 |
p = __INST(position); |
|
465 |
l = __INST(readLimit); |
|
252 | 466 |
|
611 | 467 |
if (__isNonNilObject(coll) && __bothSmallInteger(p, l)) { |
1 | 468 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
469 |
pos = __intVal(p); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
470 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
471 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
472 |
if (pos <= __intVal(l) && pos > 0) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
473 |
cls = __qClass(coll); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
474 |
if (cls == @global(String)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
475 |
if (pos <= __stringSize(coll)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
476 |
ch = __stringVal(coll)[pos-1]; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
477 |
RETURN ( __MKCHARACTER(ch) ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
478 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
479 |
} else if (cls == @global(ByteArray)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
480 |
if (pos <= __byteArraySize(coll)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
481 |
ch = __ByteArrayInstPtr(coll)->ba_element[pos-1]; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
482 |
RETURN ( __MKSMALLINT(ch) ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
483 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
484 |
} else if (cls == @global(Array)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
485 |
if (pos <= __arraySize(coll)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
486 |
RETURN ( __ArrayInstPtr(coll)->a_element[pos-1]); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
487 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
488 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
489 |
} |
1 | 490 |
} |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
491 |
%}. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
492 |
((position + 1 - ZeroPosition) > readLimit) ifTrue:[^ self pastEnd]. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
493 |
^ collection at:(position + 1 - ZeroPosition) |
1 | 494 |
! |
495 |
||
3316 | 496 |
peekOrNil |
497 |
"return the next element; do NOT advance read pointer. |
|
498 |
return nil, if there is no next element. |
|
499 |
This is much like #peek - |
|
500 |
However, unlike #peek, this does not raise an atEnd-query signal - even |
|
501 |
if handled. Instead, nil is returned immediately." |
|
502 |
||
503 |
%{ /* NOCONTEXT */ |
|
504 |
||
505 |
REGISTER int pos; |
|
506 |
unsigned ch; |
|
507 |
OBJ coll; |
|
508 |
OBJ cls, p, l; |
|
509 |
||
510 |
coll = __INST(collection); |
|
511 |
p = __INST(position); |
|
512 |
l = __INST(readLimit); |
|
513 |
||
514 |
if (__isNonNilObject(coll) && __bothSmallInteger(p, l)) { |
|
515 |
||
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
516 |
pos = __intVal(p); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
517 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
518 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
519 |
if (pos <= __intVal(l) && pos > 0) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
520 |
cls = __qClass(coll); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
521 |
if (cls == @global(String)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
522 |
if (pos <= __stringSize(coll)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
523 |
ch = __stringVal(coll)[pos-1]; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
524 |
RETURN ( __MKCHARACTER(ch) ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
525 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
526 |
RETURN ( nil ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
527 |
} else if (cls == @global(ByteArray)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
528 |
if (pos <= __byteArraySize(coll)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
529 |
ch = __ByteArrayInstPtr(coll)->ba_element[pos-1]; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
530 |
RETURN ( __MKSMALLINT(ch) ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
531 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
532 |
RETURN ( nil ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
533 |
} else if (cls == @global(Array)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
534 |
if (pos <= __arraySize(coll)) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
535 |
RETURN ( __ArrayInstPtr(coll)->a_element[pos-1]); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
536 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
537 |
RETURN ( nil ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
538 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
539 |
} |
3316 | 540 |
} |
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
541 |
%}. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
542 |
((position + 1 - ZeroPosition) > readLimit) ifTrue:[^ nil]. |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
543 |
^ collection at:(position + 1 - ZeroPosition) |
3316 | 544 |
! |
545 |
||
1 | 546 |
skipSeparators |
547 |
"skip all whitespace; next will return next non-white-space element. |
|
59 | 548 |
Return the peeked character or nil, if the end-of-stream was reached. |
2 | 549 |
- reimplemented for speed on String-Streams for faster scanning" |
1 | 550 |
|
551 |
%{ /* NOCONTEXT */ |
|
252 | 552 |
OBJ coll, p, l; |
1 | 553 |
|
1133 | 554 |
coll = __INST(collection); |
555 |
p = __INST(position); |
|
556 |
l = __INST(readLimit); |
|
252 | 557 |
|
558 |
if (__isString(coll) && __bothSmallInteger(p, l)) { |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
559 |
REGISTER unsigned char *chars; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
560 |
REGISTER unsigned ch; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
561 |
REGISTER int pos; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
562 |
int limit; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
563 |
int sz; |
1 | 564 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
565 |
pos = __intVal(p); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
566 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
567 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
568 |
if (pos <= 0) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
569 |
RETURN ( nil ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
570 |
} |
1 | 571 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
572 |
limit = __intVal(l); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
573 |
sz = __qSize(coll) - OHDR_SIZE; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
574 |
if (limit > sz) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
575 |
limit = sz; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
576 |
} |
1 | 577 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
578 |
chars = (unsigned char *)(__stringVal(coll) + pos - 1); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
579 |
while (pos <= limit) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
580 |
pos++; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
581 |
ch = *chars++; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
582 |
if ((ch > 0x20) |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
583 |
|| ((ch != ' ') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
584 |
&& (ch != '\t') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
585 |
&& (ch != '\r') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
586 |
&& (ch != '\n') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
587 |
&& (ch != '\f') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
588 |
&& (ch != 0x0B))) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
589 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
590 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
591 |
__INST(position) = __MKSMALLINT(pos-1); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
592 |
RETURN ( __MKCHARACTER(ch) ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
593 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
594 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
595 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
596 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
597 |
__INST(position) = __MKSMALLINT(pos); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
598 |
RETURN ( nil ); |
1 | 599 |
} |
1406 | 600 |
%}. |
1 | 601 |
^ super skipSeparators |
1406 | 602 |
|
603 |
" |
|
604 |
|s| |
|
605 |
||
606 |
s := ' hello world ' readStream. |
|
607 |
s skipSeparators. |
|
608 |
s next. |
|
609 |
" |
|
1 | 610 |
! |
611 |
||
13 | 612 |
skipSeparatorsExceptCR |
613 |
"skip all whitespace except newlines; |
|
202 | 614 |
next will return next non-white-space element. |
615 |
- reimplemented for speed on String-Streams for faster scanning" |
|
616 |
||
13 | 617 |
%{ /* NOCONTEXT */ |
618 |
||
252 | 619 |
OBJ coll, p, l; |
620 |
||
1133 | 621 |
coll = __INST(collection); |
622 |
p = __INST(position); |
|
623 |
l = __INST(readLimit); |
|
252 | 624 |
|
625 |
if (__isString(coll) && __bothSmallInteger(p, l)) { |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
626 |
REGISTER unsigned char *chars; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
627 |
REGISTER unsigned ch; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
628 |
REGISTER int pos; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
629 |
int limit; |
13 | 630 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
631 |
pos = __intVal(p); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
632 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
633 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
634 |
if (pos <= 0) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
635 |
RETURN ( nil ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
636 |
} |
2162
7e1601f633b6
ff is a separator too (in #skipSeparators*)
Claus Gittinger <cg@exept.de>
parents:
1688
diff
changeset
|
637 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
638 |
limit = __intVal(l); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
639 |
if (limit > (__qSize(coll) - OHDR_SIZE)) |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
640 |
limit = __qSize(coll) - OHDR_SIZE; |
13 | 641 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
642 |
chars = (unsigned char *)(__stringVal(coll) + pos - 1); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
643 |
while (pos <= limit) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
644 |
ch = *chars++; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
645 |
if (((int)ch > 0x20) |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
646 |
|| ( |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
647 |
(ch != ' ') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
648 |
&& (ch != '\t') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
649 |
&& (ch != '\f') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
650 |
&& (ch != '\b') |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
651 |
&& (ch != 0x0B))) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
652 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
653 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
654 |
__INST(position) = __MKSMALLINT(pos); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
655 |
RETURN ( __MKCHARACTER(ch) ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
656 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
657 |
pos++; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
658 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
659 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
660 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
661 |
__INST(position) = __MKSMALLINT(pos); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
662 |
RETURN ( nil ); |
13 | 663 |
} |
664 |
%} |
|
665 |
. |
|
666 |
^ super skipSeparatorsExceptCR |
|
667 |
! |
|
668 |
||
611 | 669 |
skipThrough:anObject |
6011
3b91d7834ca5
fixed: skipThrough dod not position atEnd if the element was not found.
Claus Gittinger <cg@exept.de>
parents:
5810
diff
changeset
|
670 |
"skip all objects up-to and including anObject. |
3b91d7834ca5
fixed: skipThrough dod not position atEnd if the element was not found.
Claus Gittinger <cg@exept.de>
parents:
5810
diff
changeset
|
671 |
Return the receiver if skip was successful, |
3b91d7834ca5
fixed: skipThrough dod not position atEnd if the element was not found.
Claus Gittinger <cg@exept.de>
parents:
5810
diff
changeset
|
672 |
otherwise (i.e. if not found) return nil and leave the stream positioned at the end. |
611 | 673 |
On success, the next read operation will return the element after anObject. |
674 |
- reimplemented for speed on String-Streams for faster scanning" |
|
675 |
||
676 |
%{ /* NOCONTEXT */ |
|
677 |
OBJ coll, p, l; |
|
678 |
||
1133 | 679 |
coll = __INST(collection); |
680 |
p = __INST(position); |
|
681 |
l = __INST(readLimit); |
|
611 | 682 |
|
683 |
if (__isString(coll) |
|
684 |
&& __isCharacter(anObject) |
|
685 |
&& __bothSmallInteger(p, l)) { |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
686 |
REGISTER unsigned char *chars; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
687 |
REGISTER int pos, limit; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
688 |
unsigned ch; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
689 |
int sz; |
611 | 690 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
691 |
pos = __intVal(p); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
692 |
/* make 1-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
693 |
pos = pos + 1 - __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
694 |
if (pos <= 0) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
695 |
RETURN ( nil ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
696 |
} |
611 | 697 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
698 |
limit = __intVal(l); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
699 |
sz = __stringSize(coll); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
700 |
if (limit > sz) limit = sz; |
611 | 701 |
|
7051
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
702 |
chars = (unsigned char *)(__stringVal(coll) + pos - 1); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
703 |
ch = __intVal(_characterVal(anObject)) & 0xFF; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
704 |
while (pos < limit) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
705 |
if (*chars == ch) { |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
706 |
ch = *++chars; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
707 |
pos++; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
708 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
709 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
710 |
__INST(position) = __MKSMALLINT(pos); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
711 |
RETURN ( self ); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
712 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
713 |
chars++; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
714 |
pos++; |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
715 |
} |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
716 |
/* make ZeroPosition-based */ |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
717 |
pos = pos - 1 + __intVal( @global(PositionableStream:ZeroPosition)); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
718 |
__INST(position) = __MKSMALLINT(pos+1); |
984d8271d06b
preps for 0-based stream positions
Claus Gittinger <cg@exept.de>
parents:
6814
diff
changeset
|
719 |
RETURN ( nil ); |
611 | 720 |
} |
6011
3b91d7834ca5
fixed: skipThrough dod not position atEnd if the element was not found.
Claus Gittinger <cg@exept.de>
parents:
5810
diff
changeset
|
721 |
%}. |
611 | 722 |
^ super skipThrough:anObject |
1 | 723 |
! ! |
724 |
||
59 | 725 |
!ReadStream methodsFor:'writing'! |
1 | 726 |
|
727 |
nextPut:anElement |
|
10 | 728 |
"catch write access to readstreams - report an error" |
729 |
||
730 |
self shouldNotImplement |
|
1 | 731 |
! ! |
611 | 732 |
|
2162
7e1601f633b6
ff is a separator too (in #skipSeparators*)
Claus Gittinger <cg@exept.de>
parents:
1688
diff
changeset
|
733 |
!ReadStream class methodsFor:'documentation'! |
701 | 734 |
|
735 |
version |
|
8098
8d1d5cd8529b
nextByte should (at least) return integer when reading from a string-stream
Claus Gittinger <cg@exept.de>
parents:
7483
diff
changeset
|
736 |
^ '$Header: /cvs/stx/stx/libbasic/ReadStream.st,v 1.49 2004-03-05 20:00:26 cg Exp $' |
701 | 737 |
! ! |