author | Claus Gittinger <cg@exept.de> |
Tue, 01 Dec 2009 23:11:19 +0100 | |
changeset 12577 | a3224998ea6c |
parent 12433 | b8654ecbc50d |
child 12592 | 9c9566d9c44d |
permissions | -rw-r--r-- |
8148 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
8081 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
14 |
"{ NameSpace: CharacterEncoderImplementations }" |
|
15 |
||
8134 | 16 |
CharacterEncoder subclass:#SingleByteEncoder |
8081 | 17 |
instanceVariableNames:'' |
18 |
classVariableNames:'' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Collections-Text-Encodings' |
|
21 |
! |
|
22 |
||
8148 | 23 |
!SingleByteEncoder class methodsFor:'documentation'! |
24 |
||
25 |
copyright |
|
26 |
" |
|
27 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
8811 | 37 |
! |
38 |
||
39 |
documentation |
|
40 |
" |
|
41 |
Common abstract superclass for all single-byte encodings. |
|
42 |
||
43 |
[author:] |
|
44 |
Claus Gittinger |
|
45 |
" |
|
8148 | 46 |
! ! |
8081 | 47 |
|
48 |
!SingleByteEncoder class methodsFor:'queries'! |
|
49 |
||
50 |
maxCode |
|
51 |
^ 255 |
|
52 |
! |
|
53 |
||
54 |
minCode |
|
55 |
^ 0 |
|
56 |
! ! |
|
57 |
||
58 |
!SingleByteEncoder methodsFor:'private'! |
|
59 |
||
60 |
newString:size |
|
61 |
^ String uninitializedNew:size |
|
62 |
! ! |
|
63 |
||
11997 | 64 |
!SingleByteEncoder methodsFor:'queries'! |
65 |
||
66 |
characterSize:codePoint |
|
67 |
||
68 |
^1 |
|
69 |
||
70 |
"Created: / 15-06-2005 / 15:11:24 / janfrog" |
|
71 |
! ! |
|
72 |
||
73 |
!SingleByteEncoder methodsFor:'stream support'! |
|
74 |
||
75 |
readNext:charactersToRead charactersFrom:stream |
|
76 |
||
77 |
^self decodeString:(stream next:charactersToRead) |
|
78 |
||
79 |
"Created: / 16-06-2005 / 11:45:52 / masca" |
|
80 |
! |
|
81 |
||
82 |
readNextCharacterFrom:aStream |
|
83 |
||
84 |
| c | |
|
85 |
||
86 |
c := aStream next |
|
87 |
||
88 |
^ c isNil |
|
89 |
ifTrue: [nil] |
|
90 |
ifFalse: [(self decode:c asInteger) asCharacter] |
|
91 |
||
92 |
"Created: / 14-06-2005 / 17:03:21 / janfrog" |
|
93 |
"Modified: / 15-06-2005 / 15:27:49 / janfrog" |
|
94 |
"Modified: / 20-06-2005 / 13:13:52 / masca" |
|
12433
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
95 |
! |
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
96 |
|
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
97 |
readNextInputCharacterFrom:aStream |
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
98 |
^ aStream next |
11997 | 99 |
! ! |
100 |
||
8081 | 101 |
!SingleByteEncoder class methodsFor:'documentation'! |
102 |
||
103 |
version |
|
12433
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
104 |
^ '$Header: /cvs/stx/stx/libbasic/Attic/Encoder_SingleByteEncoder.st,v 1.7 2009-11-04 00:46:50 cg Exp $' |
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
105 |
! |
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
106 |
|
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
107 |
version_CVS |
b8654ecbc50d
added: #readNextInputCharacterFrom:
Claus Gittinger <cg@exept.de>
parents:
11997
diff
changeset
|
108 |
^ '$Header: /cvs/stx/stx/libbasic/Attic/Encoder_SingleByteEncoder.st,v 1.7 2009-11-04 00:46:50 cg Exp $' |
8081 | 109 |
! ! |