author | Stefan Vogel <sv@exept.de> |
Wed, 12 Dec 2012 23:55:08 +0100 | |
changeset 2865 | 6f8b04862cc9 |
parent 1415 | 3ef6a2c42611 |
child 3533 | 1465b5fed73e |
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 |
" |
|
1415
3ef6a2c42611
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1404
diff
changeset
|
12 |
"{ Package: 'stx:libbasic2' }" |
1404 | 13 |
|
14 |
CharacterArray variableLongSubclass:#FourByteString |
|
15 |
instanceVariableNames:'' |
|
16 |
classVariableNames:'' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Collections-Text' |
|
19 |
! |
|
20 |
||
21 |
!FourByteString class methodsFor:'documentation'! |
|
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
26 |
All Rights Reserved |
|
27 |
||
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 |
FourByteStrings are like strings, but storing 32bits per character. |
|
40 |
The integration of them into the system is not completed .... |
|
41 |
||
42 |
[author:] |
|
43 |
Claus Gittinger |
|
44 |
||
45 |
[see also:] |
|
46 |
Text TwoByteString UnicodeEncodedString |
|
47 |
StringCollection |
|
48 |
" |
|
49 |
! ! |
|
50 |
||
51 |
!FourByteString class methodsFor:'initialization'! |
|
52 |
||
53 |
initialize |
|
54 |
"initialize the class - private" |
|
55 |
||
56 |
self flags:(Behavior flagLongs) |
|
57 |
||
58 |
" |
|
59 |
FourByteString initialize |
|
60 |
" |
|
61 |
||
62 |
"Modified: 22.4.1996 / 16:14:14 / cg" |
|
63 |
! ! |
|
64 |
||
65 |
!FourByteString class methodsFor:'instance creation'! |
|
66 |
||
67 |
basicNew:anInteger |
|
68 |
"return a new empty string with anInteger characters" |
|
69 |
||
70 |
^ (super basicNew:anInteger) atAllPut:(Character space) |
|
71 |
||
72 |
"Modified: 26.2.1996 / 14:38:47 / cg" |
|
73 |
! ! |
|
74 |
||
75 |
!FourByteString methodsFor:'accessing'! |
|
76 |
||
77 |
basicAt:index |
|
78 |
"return the character at position index, an Integer |
|
79 |
- reimplemented here since we return 32-bit characters" |
|
80 |
||
81 |
|val| |
|
82 |
||
83 |
val := super basicAt:index. |
|
84 |
^ Character value:val |
|
85 |
! |
|
86 |
||
87 |
basicAt:index put:aCharacter |
|
88 |
"store the argument, aCharacter at position index, an Integer. |
|
89 |
Returns aCharacter (sigh). |
|
90 |
- reimplemented here since we store 32-bit characters" |
|
91 |
||
92 |
|val| |
|
93 |
||
1415
3ef6a2c42611
Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents:
1404
diff
changeset
|
94 |
val := aCharacter codePoint. |
1404 | 95 |
super basicAt:index put:val. |
96 |
^ aCharacter |
|
97 |
! ! |
|
98 |
||
99 |
!FourByteString methodsFor:'queries'! |
|
100 |
||
101 |
bitsPerCharacter |
|
102 |
"return the number of bits each character has. |
|
103 |
Here, 32 is returned (storing quad byte characters)." |
|
104 |
||
105 |
^ 32 |
|
2865 | 106 |
! |
107 |
||
108 |
isWideString |
|
109 |
^ true |
|
1404 | 110 |
! ! |
111 |
||
112 |
!FourByteString class methodsFor:'documentation'! |
|
113 |
||
114 |
version |
|
2865 | 115 |
^ '$Header: /cvs/stx/stx/libbasic2/FourByteString.st,v 1.3 2012-12-12 22:55:08 stefan Exp $' |
1404 | 116 |
! ! |
117 |
||
118 |
FourByteString initialize! |