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