author | Claus Gittinger <cg@exept.de> |
Fri, 21 May 1999 12:10:11 +0200 | |
changeset 4217 | 32983e39bb9e |
parent 1382 | 93c125a594c3 |
child 4219 | 4f96dd118e81 |
permissions | -rw-r--r-- |
1 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
235 | 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 |
||
4217 | 13 |
CharacterArray variableWordSubclass:#TwoByteString |
992
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
14 |
instanceVariableNames:'' |
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
15 |
classVariableNames:'' |
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
16 |
poolDictionaries:'' |
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
17 |
category:'Collections-Text' |
1 | 18 |
! |
19 |
||
89 | 20 |
!TwoByteString class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
235 | 25 |
All Rights Reserved |
1 | 26 |
|
89 | 27 |
This software is furnished under a license and may be used |
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
36 |
documentation |
|
37 |
" |
|
38 |
TwoByteStrings are like strings, but storing 16bits per character. |
|
39 |
The integration of them into the system is not completed .... |
|
1290 | 40 |
|
41 |
[author:] |
|
42 |
Claus Gittinger |
|
1309 | 43 |
|
44 |
[see also:] |
|
1382 | 45 |
Text JISEncodedString |
1309 | 46 |
StringCollection |
89 | 47 |
" |
1214 | 48 |
! ! |
49 |
||
50 |
!TwoByteString class methodsFor:'initialization'! |
|
996 | 51 |
|
52 |
initialize |
|
1253 | 53 |
"initialize the class - private" |
54 |
||
996 | 55 |
self flags:(Behavior flagWords) |
56 |
||
57 |
" |
|
58 |
TwoByteString initialize |
|
59 |
" |
|
1214 | 60 |
|
1253 | 61 |
"Modified: 22.4.1996 / 16:14:14 / cg" |
89 | 62 |
! ! |
1 | 63 |
|
64 |
!TwoByteString class methodsFor:'instance creation'! |
|
65 |
||
66 |
basicNew:anInteger |
|
67 |
"return a new empty string with anInteger characters" |
|
68 |
||
1024 | 69 |
^ (super basicNew:anInteger) atAllPut:(Character space) |
70 |
||
71 |
"Modified: 26.2.1996 / 14:38:47 / cg" |
|
1 | 72 |
! ! |
73 |
||
74 |
!TwoByteString methodsFor:'accessing'! |
|
75 |
||
76 |
basicAt:index |
|
77 |
"return the character at position index, an Integer |
|
73 | 78 |
- reimplemented here since we return 16-bit characters" |
1 | 79 |
|
1024 | 80 |
|val| |
63 | 81 |
|
1024 | 82 |
val := super basicAt:index. |
63 | 83 |
^ Character value:val |
1024 | 84 |
|
85 |
"Modified: 26.2.1996 / 17:02:16 / cg" |
|
1 | 86 |
! |
87 |
||
88 |
basicAt:index put:aCharacter |
|
1230 | 89 |
"store the argument, aCharacter at position index, an Integer. |
90 |
Returns aCharacter (sigh). |
|
73 | 91 |
- reimplemented here since we store 16-bit characters" |
1 | 92 |
|
1024 | 93 |
|val| |
94 |
||
63 | 95 |
val := aCharacter asciiValue. |
1024 | 96 |
super basicAt:index put:val. |
63 | 97 |
^ aCharacter |
608 | 98 |
|
1230 | 99 |
"Modified: 19.4.1996 / 11:16:22 / cg" |
1014 | 100 |
! ! |
101 |
||
608 | 102 |
!TwoByteString methodsFor:'queries'! |
103 |
||
1017 | 104 |
bitsPerCharacter |
1239 | 105 |
"return the number of bits each character has. |
106 |
Here, 16 is returned (storing double byte characters)." |
|
107 |
||
1017 | 108 |
^ 16 |
1239 | 109 |
|
110 |
"Modified: 20.4.1996 / 23:08:38 / cg" |
|
608 | 111 |
! ! |
112 |
||
631 | 113 |
!TwoByteString class methodsFor:'documentation'! |
114 |
||
115 |
version |
|
4217 | 116 |
^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.28 1999-05-21 10:10:11 cg Exp $' |
631 | 117 |
! ! |
996 | 118 |
TwoByteString initialize! |