author | Claus Gittinger <cg@exept.de> |
Sat, 20 Apr 1996 23:09:08 +0200 | |
changeset 1239 | 91a688ac83de |
parent 1230 | c349c4e9e594 |
child 1253 | 7265cbaa8ec9 |
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 |
||
256 | 13 |
CharacterArray subclass:#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 .... |
|
40 |
" |
|
1214 | 41 |
! ! |
42 |
||
43 |
!TwoByteString class methodsFor:'initialization'! |
|
996 | 44 |
|
45 |
initialize |
|
46 |
self flags:(Behavior flagWords) |
|
47 |
||
48 |
" |
|
49 |
TwoByteString initialize |
|
50 |
" |
|
1214 | 51 |
|
52 |
"Modified: 18.4.1996 / 17:56:32 / cg" |
|
89 | 53 |
! ! |
1 | 54 |
|
55 |
!TwoByteString class methodsFor:'instance creation'! |
|
56 |
||
57 |
basicNew:anInteger |
|
58 |
"return a new empty string with anInteger characters" |
|
59 |
||
1024 | 60 |
^ (super basicNew:anInteger) atAllPut:(Character space) |
61 |
||
62 |
"Modified: 26.2.1996 / 14:38:47 / cg" |
|
1 | 63 |
! ! |
64 |
||
65 |
!TwoByteString methodsFor:'accessing'! |
|
66 |
||
67 |
basicAt:index |
|
68 |
"return the character at position index, an Integer |
|
73 | 69 |
- reimplemented here since we return 16-bit characters" |
1 | 70 |
|
1024 | 71 |
|val| |
63 | 72 |
|
1024 | 73 |
val := super basicAt:index. |
63 | 74 |
^ Character value:val |
1024 | 75 |
|
76 |
"Modified: 26.2.1996 / 17:02:16 / cg" |
|
1 | 77 |
! |
78 |
||
79 |
basicAt:index put:aCharacter |
|
1230 | 80 |
"store the argument, aCharacter at position index, an Integer. |
81 |
Returns aCharacter (sigh). |
|
73 | 82 |
- reimplemented here since we store 16-bit characters" |
1 | 83 |
|
1024 | 84 |
|val| |
85 |
||
63 | 86 |
val := aCharacter asciiValue. |
1024 | 87 |
super basicAt:index put:val. |
63 | 88 |
^ aCharacter |
608 | 89 |
|
1230 | 90 |
"Modified: 19.4.1996 / 11:16:22 / cg" |
1014 | 91 |
! ! |
92 |
||
608 | 93 |
!TwoByteString methodsFor:'queries'! |
94 |
||
1017 | 95 |
bitsPerCharacter |
1239 | 96 |
"return the number of bits each character has. |
97 |
Here, 16 is returned (storing double byte characters)." |
|
98 |
||
1017 | 99 |
^ 16 |
1239 | 100 |
|
101 |
"Modified: 20.4.1996 / 23:08:38 / cg" |
|
608 | 102 |
! ! |
103 |
||
631 | 104 |
!TwoByteString class methodsFor:'documentation'! |
105 |
||
106 |
version |
|
1239 | 107 |
^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.23 1996-04-20 21:08:52 cg Exp $' |
631 | 108 |
! ! |
996 | 109 |
TwoByteString initialize! |