author | Stefan Vogel <sv@exept.de> |
Thu, 12 Aug 2004 17:48:55 +0200 | |
changeset 8472 | 5e8d452b5d75 |
parent 8407 | f3a5a24b8fec |
child 8942 | 41d4d78ceb65 |
permissions | -rw-r--r-- |
7946 | 1 |
" |
2 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
||
13 |
" |
|
14 |
||
7982 | 15 |
"{ Package: 'stx:libbasic2' }" |
7946 | 16 |
|
17 |
TwoByteString variableWordSubclass:#Unicode16String |
|
18 |
instanceVariableNames:'' |
|
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
21 |
category:'Collections-Text' |
|
22 |
! |
|
23 |
||
24 |
!Unicode16String class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 1997 by eXept Software AG |
|
29 |
All Rights Reserved |
|
30 |
||
31 |
This software is furnished under a license and may be used |
|
32 |
only in accordance with the terms of that license and with the |
|
33 |
inclusion of the above copyright notice. This software may not |
|
34 |
be provided or otherwise made available to, or used by, any |
|
35 |
other person. No title to or ownership of the software is |
|
36 |
hereby transferred. |
|
37 |
||
38 |
||
39 |
" |
|
40 |
! |
|
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
Not yet finished - unicode support is currently being implemented. |
|
45 |
" |
|
46 |
! ! |
|
47 |
||
48 |
!Unicode16String class methodsFor:'initialization'! |
|
49 |
||
50 |
initialize |
|
51 |
"initialize the class - private" |
|
52 |
||
7949 | 53 |
self flags:(Behavior flagWords). |
54 |
||
55 |
Smalltalk at:#UnicodeString put:Unicode16String. |
|
7946 | 56 |
|
57 |
" |
|
58 |
Unicode16String initialize |
|
59 |
" |
|
60 |
||
61 |
"Created: 30.6.1997 / 15:35:52 / cg" |
|
62 |
"Modified: 30.6.1997 / 15:39:21 / cg" |
|
63 |
! ! |
|
64 |
||
8407
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
65 |
!Unicode16String methodsFor:'binary storage'! |
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
66 |
|
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
67 |
storeBinaryElementsOn: stream |
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
68 |
self do:[:each| |
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
69 |
stream nextPutShort:each asInteger MSB:true. |
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
70 |
]. |
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
71 |
! ! |
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
72 |
|
7946 | 73 |
!Unicode16String methodsFor:'conversion'! |
74 |
||
75 |
asSymbolIfInterned |
|
76 |
|s| |
|
77 |
||
78 |
Error catch:[ |
|
79 |
s := self asSingleByteString. |
|
80 |
]. |
|
81 |
s isNil ifTrue:[^ s]. |
|
82 |
^ s asSymbolIfInterned |
|
83 |
! |
|
84 |
||
8294
ba5f4421848f
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
8049
diff
changeset
|
85 |
asUnicode16String |
ba5f4421848f
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
8049
diff
changeset
|
86 |
^ self |
ba5f4421848f
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
8049
diff
changeset
|
87 |
! |
ba5f4421848f
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
8049
diff
changeset
|
88 |
|
7946 | 89 |
asUnicodeString |
90 |
^ self |
|
91 |
! |
|
92 |
||
93 |
printOn:aStream |
|
94 |
self utf8EncodedOn:aStream |
|
95 |
! ! |
|
96 |
||
8049
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
97 |
!Unicode16String methodsFor:'printing & storing'! |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
98 |
|
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
99 |
storeString |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
100 |
"return a String for storing myself" |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
101 |
|
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
102 |
^ self basicStoreString. |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
103 |
! ! |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
104 |
|
7946 | 105 |
!Unicode16String class methodsFor:'documentation'! |
106 |
||
107 |
version |
|
8407
f3a5a24b8fec
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
8294
diff
changeset
|
108 |
^ '$Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.6 2004-06-16 12:18:56 cg Exp $' |
7946 | 109 |
! ! |
110 |
||
111 |
Unicode16String initialize! |