author | Claus Gittinger <cg@exept.de> |
Wed, 22 Oct 2008 08:42:16 +0200 | |
changeset 11265 | dd57cc0a379b |
parent 10223 | 761e2a050b69 |
child 11293 | 4b08b41f0488 |
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 |
||
10223
761e2a050b69
twoByteString moved (req'd in VM)
Claus Gittinger <cg@exept.de>
parents:
9648
diff
changeset
|
15 |
"{ Package: 'stx:libbasic' }" |
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 |
" |
|
10223
761e2a050b69
twoByteString moved (req'd in VM)
Claus Gittinger <cg@exept.de>
parents:
9648
diff
changeset
|
44 |
Represents 16-bit (2-byte) Unicode strings. |
7946 | 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 |
|
7946 | 66 |
!Unicode16String methodsFor:'conversion'! |
67 |
||
68 |
asSymbolIfInterned |
|
9232 | 69 |
"If a symbol with the receivers characters is already known, return it. Otherwise, return nil. |
70 |
Because ST/X does not support non-8-bit symbols, this method |
|
8942 | 71 |
has been redefined to only return a symbol, if the receiver does NOT contain |
72 |
any non-8 bit characters." |
|
73 |
||
7946 | 74 |
|s| |
75 |
||
76 |
Error catch:[ |
|
77 |
s := self asSingleByteString. |
|
78 |
]. |
|
79 |
s isNil ifTrue:[^ s]. |
|
80 |
^ s asSymbolIfInterned |
|
81 |
! |
|
82 |
||
8294
ba5f4421848f
Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents:
8049
diff
changeset
|
83 |
asUnicode16String |
8942 | 84 |
"as the receiver already is a unicode-16 string, return it" |
85 |
||
8294
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 |
8942 | 90 |
"as the receiver already is a unicode string, return it" |
91 |
||
7946 | 92 |
^ self |
93 |
! |
|
94 |
||
95 |
printOn:aStream |
|
8942 | 96 |
"print the receiver utf-8 encoded on aStream" |
97 |
||
7946 | 98 |
self utf8EncodedOn:aStream |
99 |
! ! |
|
100 |
||
8049
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
101 |
!Unicode16String methodsFor:'printing & storing'! |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
102 |
|
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
103 |
storeString |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
104 |
"return a String for storing myself" |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
105 |
|
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
106 |
^ self basicStoreString. |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
107 |
! ! |
ccd0e8f26439
printing - migrating towards unicodeSupport in ST-code
Claus Gittinger <cg@exept.de>
parents:
7982
diff
changeset
|
108 |
|
7946 | 109 |
!Unicode16String class methodsFor:'documentation'! |
110 |
||
111 |
version |
|
10223
761e2a050b69
twoByteString moved (req'd in VM)
Claus Gittinger <cg@exept.de>
parents:
9648
diff
changeset
|
112 |
^ '$Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.10 2006-12-06 14:12:10 cg Exp $' |
7946 | 113 |
! ! |
114 |
||
115 |
Unicode16String initialize! |