author | Stefan Vogel <sv@exept.de> |
Thu, 08 Nov 2007 15:03:14 +0100 | |
changeset 1908 | 7d5c6c7d805f |
parent 1669 | 4d79cb67a21b |
child 2048 | c57b6e0b9ef4 |
permissions | -rw-r--r-- |
1404 | 1 |
" |
2 |
COPYRIGHT (c) 2004 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 |
||
1411 | 15 |
"{ Package: 'stx:libbasic2' }" |
1404 | 16 |
|
17 |
FourByteString variableLongSubclass:#Unicode32String |
|
18 |
instanceVariableNames:'' |
|
19 |
classVariableNames:'' |
|
20 |
poolDictionaries:'' |
|
21 |
category:'Collections-Text' |
|
22 |
! |
|
23 |
||
24 |
!Unicode32String class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 2004 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 |
" |
|
1573 | 44 |
Not yet fully finished - unicode support is still being implemented. |
1404 | 45 |
" |
46 |
! ! |
|
47 |
||
48 |
!Unicode32String class methodsFor:'initialization'! |
|
49 |
||
50 |
initialize |
|
51 |
"initialize the class - private" |
|
52 |
||
53 |
self flags:(Behavior flagLongs) |
|
54 |
||
55 |
" |
|
56 |
Unicode32String initialize |
|
57 |
" |
|
58 |
||
59 |
"Created: 30.6.1997 / 15:35:52 / cg" |
|
60 |
"Modified: 30.6.1997 / 15:39:21 / cg" |
|
61 |
! ! |
|
62 |
||
1460
6af968260a60
juergen gmeiners bug fix for bug #69
Claus Gittinger <cg@exept.de>
parents:
1443
diff
changeset
|
63 |
|
1404 | 64 |
!Unicode32String methodsFor:'conversion'! |
65 |
||
66 |
asSymbolIfInterned |
|
1605 | 67 |
"If a symbol with the receivers characters is already known, return it. Otherwise, return nil. |
68 |
Because ST/X does not support non-8-bit symbols, this method |
|
1573 | 69 |
has been redefined to only return a symbol, if the receiver does NOT contain |
70 |
any non-8 bit characters." |
|
71 |
||
1404 | 72 |
|s| |
73 |
||
74 |
Error catch:[ |
|
75 |
s := self asSingleByteString. |
|
76 |
]. |
|
77 |
s isNil ifTrue:[^ s]. |
|
78 |
^ s asSymbolIfInterned |
|
79 |
! |
|
80 |
||
1443
e971d86d6259
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
1411
diff
changeset
|
81 |
asUnicode32String |
1573 | 82 |
"as the receiver already is a unicode-32 string, return it" |
83 |
||
1443
e971d86d6259
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
1411
diff
changeset
|
84 |
^ self |
e971d86d6259
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
1411
diff
changeset
|
85 |
! |
e971d86d6259
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
1411
diff
changeset
|
86 |
|
1404 | 87 |
asUnicodeString |
1573 | 88 |
"as the receiver already is a unicode string, return it" |
89 |
||
1404 | 90 |
^ self |
91 |
! |
|
92 |
||
93 |
printOn:aStream |
|
1573 | 94 |
"print the receiver utf-8 encoded on aStream" |
95 |
||
1404 | 96 |
self utf8EncodedOn:aStream |
97 |
! ! |
|
98 |
||
99 |
!Unicode32String class methodsFor:'documentation'! |
|
100 |
||
101 |
version |
|
1669 | 102 |
^ '$Header: /cvs/stx/stx/libbasic2/Unicode32String.st,v 1.7 2006-08-23 14:07:15 cg Exp $' |
1404 | 103 |
! ! |
104 |
||
105 |
Unicode32String initialize! |