TwoByteString.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 18:20:46 +0200
changeset 1290 15ba3221b89b
parent 1253 7265cbaa8ec9
child 1309 24c98ca4a56d
permissions -rw-r--r--
documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     1
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
235
d8e62525bfdf *** empty log message ***
claus
parents: 97
diff changeset
     3
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
256
f59b4cfdc55a *** empty log message ***
claus
parents: 235
diff changeset
    13
CharacterArray subclass:#TwoByteString
992
f456f8f7d421 JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents: 631
diff changeset
    14
	instanceVariableNames:''
f456f8f7d421 JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents: 631
diff changeset
    15
	classVariableNames:''
f456f8f7d421 JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents: 631
diff changeset
    16
	poolDictionaries:''
f456f8f7d421 JIS decode now in CharacterArray
Claus Gittinger <cg@exept.de>
parents: 631
diff changeset
    17
	category:'Collections-Text'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    18
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    19
89
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    20
!TwoByteString class methodsFor:'documentation'!
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    21
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    22
copyright
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    23
"
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    24
 COPYRIGHT (c) 1993 by Claus Gittinger
235
d8e62525bfdf *** empty log message ***
claus
parents: 97
diff changeset
    25
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    26
89
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    27
 This software is furnished under a license and may be used
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    28
 only in accordance with the terms of that license and with the
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    29
 inclusion of the above copyright notice.   This software may not
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    30
 be provided or otherwise made available to, or used by, any
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    31
 other person.  No title to or ownership of the software is
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    32
 hereby transferred.
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    33
"
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    34
!
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    35
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    36
documentation
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    37
"
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    38
    TwoByteStrings are like strings, but storing 16bits per character.
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    39
    The integration of them into the system is not completed ....
1290
15ba3221b89b documentation
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
    40
15ba3221b89b documentation
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
    41
    [author:]
15ba3221b89b documentation
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
    42
        Claus Gittinger
89
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    43
"
1214
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
    44
! !
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
    45
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
    46
!TwoByteString class methodsFor:'initialization'!
996
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
    47
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
    48
initialize
1253
7265cbaa8ec9 commentary
Claus Gittinger <cg@exept.de>
parents: 1239
diff changeset
    49
    "initialize the class - private"
7265cbaa8ec9 commentary
Claus Gittinger <cg@exept.de>
parents: 1239
diff changeset
    50
996
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
    51
    self flags:(Behavior flagWords)
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
    52
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
    53
    "
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
    54
     TwoByteString initialize
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
    55
    "
1214
Claus Gittinger <cg@exept.de>
parents: 1024
diff changeset
    56
1253
7265cbaa8ec9 commentary
Claus Gittinger <cg@exept.de>
parents: 1239
diff changeset
    57
    "Modified: 22.4.1996 / 16:14:14 / cg"
89
7be0b86ef80f *** empty log message ***
claus
parents: 73
diff changeset
    58
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    59
a27a279701f8 Initial revision
claus
parents:
diff changeset
    60
!TwoByteString class methodsFor:'instance creation'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    61
a27a279701f8 Initial revision
claus
parents:
diff changeset
    62
basicNew:anInteger
a27a279701f8 Initial revision
claus
parents:
diff changeset
    63
    "return a new empty string with anInteger characters"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    64
1024
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    65
    ^ (super basicNew:anInteger) atAllPut:(Character space)
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    66
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    67
    "Modified: 26.2.1996 / 14:38:47 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    68
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
    69
a27a279701f8 Initial revision
claus
parents:
diff changeset
    70
!TwoByteString methodsFor:'accessing'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    71
a27a279701f8 Initial revision
claus
parents:
diff changeset
    72
basicAt:index
a27a279701f8 Initial revision
claus
parents:
diff changeset
    73
    "return the character at position index, an Integer
73
a6640cc96199 *** empty log message ***
claus
parents: 63
diff changeset
    74
     - reimplemented here since we return 16-bit characters"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    75
1024
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    76
    |val|
63
1f0cdefb013f *** empty log message ***
claus
parents: 33
diff changeset
    77
1024
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    78
    val := super basicAt:index.
63
1f0cdefb013f *** empty log message ***
claus
parents: 33
diff changeset
    79
    ^ Character value:val
1024
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    80
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    81
    "Modified: 26.2.1996 / 17:02:16 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    82
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    83
a27a279701f8 Initial revision
claus
parents:
diff changeset
    84
basicAt:index put:aCharacter
1230
c349c4e9e594 commentary
Claus Gittinger <cg@exept.de>
parents: 1214
diff changeset
    85
    "store the argument, aCharacter at position index, an Integer.
c349c4e9e594 commentary
Claus Gittinger <cg@exept.de>
parents: 1214
diff changeset
    86
     Returns aCharacter (sigh).
73
a6640cc96199 *** empty log message ***
claus
parents: 63
diff changeset
    87
     - reimplemented here since we store 16-bit characters"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    88
1024
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    89
    |val|
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    90
63
1f0cdefb013f *** empty log message ***
claus
parents: 33
diff changeset
    91
    val := aCharacter asciiValue.
1024
9a14acfb50ee 16bit coding
Claus Gittinger <cg@exept.de>
parents: 1017
diff changeset
    92
    super basicAt:index put:val.
63
1f0cdefb013f *** empty log message ***
claus
parents: 33
diff changeset
    93
    ^ aCharacter
608
cd5ac440fa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    94
1230
c349c4e9e594 commentary
Claus Gittinger <cg@exept.de>
parents: 1214
diff changeset
    95
    "Modified: 19.4.1996 / 11:16:22 / cg"
1014
da30760cfd3e dummy encoding support
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
    96
! !
da30760cfd3e dummy encoding support
Claus Gittinger <cg@exept.de>
parents: 996
diff changeset
    97
608
cd5ac440fa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    98
!TwoByteString methodsFor:'queries'!
cd5ac440fa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
    99
1017
2665a2628779 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   100
bitsPerCharacter
1239
91a688ac83de commentary
Claus Gittinger <cg@exept.de>
parents: 1230
diff changeset
   101
    "return the number of bits each character has.
91a688ac83de commentary
Claus Gittinger <cg@exept.de>
parents: 1230
diff changeset
   102
     Here, 16 is returned (storing double byte characters)."
91a688ac83de commentary
Claus Gittinger <cg@exept.de>
parents: 1230
diff changeset
   103
1017
2665a2628779 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1014
diff changeset
   104
    ^ 16
1239
91a688ac83de commentary
Claus Gittinger <cg@exept.de>
parents: 1230
diff changeset
   105
91a688ac83de commentary
Claus Gittinger <cg@exept.de>
parents: 1230
diff changeset
   106
    "Modified: 20.4.1996 / 23:08:38 / cg"
608
cd5ac440fa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   107
! !
cd5ac440fa95 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 530
diff changeset
   108
631
d43deb0ec558 version at the end
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
   109
!TwoByteString class methodsFor:'documentation'!
d43deb0ec558 version at the end
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
   110
d43deb0ec558 version at the end
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
   111
version
1290
15ba3221b89b documentation
Claus Gittinger <cg@exept.de>
parents: 1253
diff changeset
   112
    ^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.25 1996-04-25 16:17:19 cg Exp $'
631
d43deb0ec558 version at the end
Claus Gittinger <cg@exept.de>
parents: 608
diff changeset
   113
! !
996
560a05298da9 I really store shorts ...
Claus Gittinger <cg@exept.de>
parents: 992
diff changeset
   114
TwoByteString initialize!