author | Claus Gittinger <cg@exept.de> |
Wed, 23 Aug 2006 16:08:50 +0200 | |
changeset 9666 | cdcff7e1794f |
parent 8094 | d05f69bd0097 |
child 10223 | 761e2a050b69 |
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 |
||
8094
d05f69bd0097
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
5761
diff
changeset
|
13 |
"{ Package: 'stx:libbasic2' }" |
d05f69bd0097
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
5761
diff
changeset
|
14 |
|
5761 | 15 |
CharacterArray variableWordSubclass:#TwoByteString |
992
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
16 |
instanceVariableNames:'' |
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
17 |
classVariableNames:'' |
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
18 |
poolDictionaries:'' |
f456f8f7d421
JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents:
631
diff
changeset
|
19 |
category:'Collections-Text' |
1 | 20 |
! |
21 |
||
89 | 22 |
!TwoByteString class methodsFor:'documentation'! |
23 |
||
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
235 | 27 |
All Rights Reserved |
1 | 28 |
|
89 | 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 |
! |
|
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
TwoByteStrings are like strings, but storing 16bits per character. |
|
41 |
The integration of them into the system is not completed .... |
|
1290 | 42 |
|
43 |
[author:] |
|
44 |
Claus Gittinger |
|
1309 | 45 |
|
46 |
[see also:] |
|
1382 | 47 |
Text JISEncodedString |
1309 | 48 |
StringCollection |
89 | 49 |
" |
1214 | 50 |
! ! |
51 |
||
52 |
!TwoByteString class methodsFor:'initialization'! |
|
996 | 53 |
|
54 |
initialize |
|
1253 | 55 |
"initialize the class - private" |
56 |
||
996 | 57 |
self flags:(Behavior flagWords) |
58 |
||
59 |
" |
|
60 |
TwoByteString initialize |
|
61 |
" |
|
1214 | 62 |
|
1253 | 63 |
"Modified: 22.4.1996 / 16:14:14 / cg" |
89 | 64 |
! ! |
1 | 65 |
|
66 |
!TwoByteString class methodsFor:'instance creation'! |
|
67 |
||
68 |
basicNew:anInteger |
|
69 |
"return a new empty string with anInteger characters" |
|
70 |
||
1024 | 71 |
^ (super basicNew:anInteger) atAllPut:(Character space) |
72 |
||
73 |
"Modified: 26.2.1996 / 14:38:47 / cg" |
|
1 | 74 |
! ! |
75 |
||
76 |
!TwoByteString methodsFor:'accessing'! |
|
77 |
||
78 |
basicAt:index |
|
79 |
"return the character at position index, an Integer |
|
73 | 80 |
- reimplemented here since we return 16-bit characters" |
1 | 81 |
|
1024 | 82 |
|val| |
63 | 83 |
|
1024 | 84 |
val := super basicAt:index. |
63 | 85 |
^ Character value:val |
1024 | 86 |
|
87 |
"Modified: 26.2.1996 / 17:02:16 / cg" |
|
1 | 88 |
! |
89 |
||
90 |
basicAt:index put:aCharacter |
|
1230 | 91 |
"store the argument, aCharacter at position index, an Integer. |
92 |
Returns aCharacter (sigh). |
|
73 | 93 |
- reimplemented here since we store 16-bit characters" |
1 | 94 |
|
8094
d05f69bd0097
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
5761
diff
changeset
|
95 |
super basicAt:index put:aCharacter codePoint. |
63 | 96 |
^ aCharacter |
608 | 97 |
|
1230 | 98 |
"Modified: 19.4.1996 / 11:16:22 / cg" |
1014 | 99 |
! ! |
100 |
||
608 | 101 |
!TwoByteString methodsFor:'queries'! |
102 |
||
1017 | 103 |
bitsPerCharacter |
1239 | 104 |
"return the number of bits each character has. |
105 |
Here, 16 is returned (storing double byte characters)." |
|
106 |
||
1017 | 107 |
^ 16 |
1239 | 108 |
|
109 |
"Modified: 20.4.1996 / 23:08:38 / cg" |
|
608 | 110 |
! ! |
111 |
||
631 | 112 |
!TwoByteString class methodsFor:'documentation'! |
113 |
||
114 |
version |
|
8094
d05f69bd0097
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
5761
diff
changeset
|
115 |
^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.31 2004-03-05 19:04:38 stefan Exp $' |
631 | 116 |
! ! |
8094
d05f69bd0097
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
5761
diff
changeset
|
117 |
|
996 | 118 |
TwoByteString initialize! |