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