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