FourByteString.st
author Claus Gittinger <cg@exept.de>
Tue, 26 Mar 2019 12:12:05 +0100
changeset 4922 ff7afd151379
parent 4920 8c94a1a0ed25
child 4923 6e6fea06fff6
permissions -rw-r--r--
#TUNING by cg class: FourByteString added: #replaceFrom:to:with:startingAt: changed: #from:to:put:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     2
 COPYRIGHT (c) 2004 by eXept Software AG
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
              All Rights Reserved
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
 This software is furnished under a license and may be used
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
 hereby transferred.
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
"
1415
3ef6a2c42611 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1404
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
3533
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    14
"{ NameSpace: Smalltalk }"
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    15
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
CharacterArray variableLongSubclass:#FourByteString
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	category:'Collections-Text'
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!FourByteString class methodsFor:'documentation'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
copyright
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
 COPYRIGHT (c) 2004 by eXept Software AG
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
              All Rights Reserved
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
 This software is furnished under a license and may be used
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
 only in accordance with the terms of that license and with the
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
 inclusion of the above copyright notice.   This software may not
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
 be provided or otherwise made available to, or used by, any
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
 other person.  No title to or ownership of the software is
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
 hereby transferred.
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
documentation
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    FourByteStrings are like strings, but storing 32bits per character.
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
    The integration of them into the system is not completed ....
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    [author:]
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        Claus Gittinger
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    [see also:]
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        Text TwoByteString UnicodeEncodedString
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        StringCollection
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
!FourByteString class methodsFor:'initialization'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
initialize
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "initialize the class - private"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    self flags:(Behavior flagLongs)
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
    "
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
     FourByteString initialize
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    "
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
    "Modified: 22.4.1996 / 16:14:14 / cg"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
!FourByteString class methodsFor:'instance creation'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
basicNew:anInteger
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    "return a new empty string with anInteger characters"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
    ^ (super basicNew:anInteger) atAllPut:(Character space)
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "Modified: 26.2.1996 / 14:38:47 / cg"
3533
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    75
!
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    76
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    77
uninitializedNew:anInteger
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    78
    "return a new empty string with anInteger characters"
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    79
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    80
    ^ super basicNew:anInteger
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    81
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    82
    "
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    83
        self uninitializedNew:10
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
    84
    "
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
!FourByteString methodsFor:'accessing'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
basicAt:index
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
    "return the character at position index, an Integer
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
     - reimplemented here since we return 32-bit characters"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    |val|
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    val := super basicAt:index.
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    ^ Character value:val
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
basicAt:index put:aCharacter
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
    "store the argument, aCharacter at position index, an Integer.
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   101
     Returns aCharacter (sigh).
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   102
     - reimplemented here since we store 32-bit characters"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   103
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    |val|
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   105
1415
3ef6a2c42611 Use #codePoint instead of deprecated #asciiValue
Stefan Vogel <sv@exept.de>
parents: 1404
diff changeset
   106
    val := aCharacter codePoint.
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
    super basicAt:index put:val.
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    ^ aCharacter
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   111
!FourByteString methodsFor:'filling and replacing'!
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   112
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   113
from:start to:stop put:aCharacter
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   114
    "fill part of the receiver with aCharacter.
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   115
     - reimplemented here for speed"
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   116
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   117
%{  /* NOCONTEXT */
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   118
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   119
    REGISTER unsigned int *dstp;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   120
    REGISTER int count, charValue;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   121
    int len, index1, index2;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   122
    OBJ cls;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   123
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   124
    // fprintf(stderr, "fill32...\n");
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   125
    if (__isCharacter(aCharacter)
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   126
     && __bothSmallInteger(start, stop)) {
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   127
        len = __unicode32StringSize(self);
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   128
        index1 = __intVal(start);
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   129
        index2 = __intVal(stop);
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   130
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   131
        dstp = __unicode32StringVal(self) + index1 - 1;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   132
        if ((cls = __qClass(self)) != @global(Unicode32String)) {
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   133
            int nInst;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   134
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   135
            nInst = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   136
            dstp += nInst;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   137
            len -= nInst;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   138
        }
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   139
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   140
        charValue = __intVal(__characterVal(aCharacter));
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   141
        if (((unsigned)charValue <= 0x0FFFFFFF)
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   142
         && (index1 <= index2)
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   143
         && (index1 > 0)
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   144
         && (index2 <= len)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   145
            count = index2 - index1 + 1;
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   146
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   147
#if (__POINTER_SIZE__ == 8)
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   148
            {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   149
                INT v2;
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   150
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   151
                v2 = (charValue << 32) | charValue;
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   152
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   153
                /* fill unaligned part */
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   154
                while ((count > 0) && (((unsigned INT)dstp & 7) != 0)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   155
                    *dstp++ = charValue;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   156
                    count--;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   157
                }
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   158
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   159
                /* fill aligned part */
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   160
                while (count >= 8) {
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   161
                    ((unsigned INT *)dstp)[0] = v2;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   162
                    ((unsigned INT *)dstp)[1] = v2;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   163
                    ((unsigned INT *)dstp)[2] = v2;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   164
                    ((unsigned INT *)dstp)[3] = v2;
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   165
                    dstp += 8;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   166
                    count -= 8;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   167
                }
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   168
                while (count >= 2) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   169
                    ((unsigned INT *)dstp)[0] = v2;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   170
                    dstp += 2;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   171
                    count -= 2;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   172
                }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   173
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   174
                /* fill rest */
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   175
                while (count > 0) {
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   176
                    *dstp++ = charValue;
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   177
                    count--;
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   178
                }
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   179
            }
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   180
#else // not 64bit
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   181
            while (count >= 8) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   182
                dstp[0] = dstp[1] = dstp[2] = dstp[3] =
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   183
                dstp[4] = dstp[5] = dstp[6] = dstp[7] = charValue;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   184
                dstp += 8;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   185
                count -= 8;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   186
            }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   187
            while (count--) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   188
                *dstp++ = charValue;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   189
            }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   190
#endif /* 64bit */
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   191
            RETURN (self);
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   192
        }
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   193
    }
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   194
%}.
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   195
    "
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   196
     fall back in case of non-integer index or out-of-bound index/value;
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   197
     will eventually lead to an out-of-bound signal raise
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   198
    "
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   199
    ^ super from:start to:stop put:aCharacter
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   200
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   201
    "
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   202
     (Unicode16String new:10) from:1 to:10 put:$a
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   203
     (Unicode16String new:20) from:10 to:20 put:$b
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   204
     (Unicode16String new:20) from:1 to:10 put:$c
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   205
     (Unicode16String new:20) from:1 to:10 put:$c 
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   206
     (Unicode16String new:100) from:2 to:99 put:$c 
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   207
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   208
     (Unicode16String new:10) from:0 to:9 put:$a
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   209
     (Unicode16String new:10) from:1 to:11 put:$a
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   210
    "
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   211
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   212
    "Created: / 26-03-2019 / 11:30:51 / Claus Gittinger"
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   213
!
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   214
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   215
replaceFrom:start to:stop with:aString startingAt:repStart
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   216
    "replace the characters starting at index start, anInteger and ending
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   217
     at stop, anInteger with characters from aString starting at repStart.
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   218
     Return the receiver.
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   219
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   220
     - reimplemented here for speed"
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   221
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   222
%{  /* NOCONTEXT */
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   223
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   224
#ifndef NO_PRIM_STRING
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   225
    if (__bothSmallInteger(start, stop)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   226
        int len;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   227
        int index1 = __intVal(start);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   228
        int index2 = __intVal(stop);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   229
        int count = index2 - index1 + 1;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   230
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   231
        if (count <= 0) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   232
             RETURN (self);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   233
        }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   234
        len = __unicode32StringSize(self);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   235
        if ((index2 <= len) && (index1 > 0)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   236
            int repIndex = __intVal(repStart);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   237
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   238
            if (__isStringLike(aString)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   239
                int repLen = __stringSize(aString);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   240
                if ((repIndex > 0) && ((repIndex + count - 1) <= repLen)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   241
                    REGISTER unsigned char *srcp = __stringVal(aString) + repIndex - 1;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   242
                    REGISTER unsigned int *dstp  = __unicode32StringVal(self) + index1 - 1;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   243
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   244
                    while (count-- > 0) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   245
                        *dstp++ = *srcp++;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   246
                    }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   247
                    RETURN (self);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   248
                }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   249
            } else if (__isTwoByteString(aString) || __isUnicode16String(aString)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   250
                int repLen = __twoByteStringSize(aString);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   251
                if ((repIndex > 0) && ((repIndex + count - 1) <= repLen)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   252
                    REGISTER unsigned short *srcp = __twoByteStringVal(aString) + repIndex - 1;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   253
                    REGISTER unsigned int *dstp  = __unicode32StringVal(self) + index1 - 1;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   254
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   255
                    while (count-- > 0) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   256
                        *dstp++ = *srcp++;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   257
                    }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   258
                    RETURN (self);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   259
                }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   260
            } else if (__isUnicode32String(aString)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   261
                int repLen = __unicode32StringSize(aString);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   262
                if ((repIndex > 0) && ((repIndex + count - 1) <= repLen)) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   263
                    REGISTER unsigned int *srcp  = __unicode32StringVal(aString) + repIndex - 1;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   264
                    REGISTER unsigned int *dstp = __unicode32StringVal(self) + index1 - 1;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   265
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   266
                    if (aString == self) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   267
                        /* take care of overlapping copy */
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   268
                        memmove(dstp, srcp, count*sizeof(int));
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   269
                        RETURN (self);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   270
                    }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   271
                    if (count > 5) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   272
                        memcpy(dstp, srcp, count*sizeof(int));
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   273
                    } else {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   274
                        while (count-- > 0) {
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   275
                            *dstp++ = *srcp++;
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   276
                        }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   277
                    }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   278
                    RETURN (self);
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   279
                }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   280
            }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   281
        }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   282
    }
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   283
#endif
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   284
%}.
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   285
    "/ arrive here if any index arg is out o range, or the source is neither a string,
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   286
    "/ nor a two-byte string.
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   287
    ^ super replaceFrom:start to:stop with:aString startingAt:repStart
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   288
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   289
    "
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   290
     'hello world' asUnicode32String replaceFrom:1 to:5 with:'123456' startingAt:2
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   291
     'hello world' asUnicode32String replaceFrom:1 to:5 with:'123456' asUnicode16String startingAt:2
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   292
     'hello world' asUnicode32String replaceFrom:1 to:5 with:'123456' asUnicode32String startingAt:2
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   293
     'hello world' asUnicode32String replaceFrom:1 to:0 with:'123456' startingAt:2
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   294
     'hello' asUnicode32String replaceFrom:1 to:6 with:'123456' startingAt:2
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   295
     'hello world' asUnicode32String replaceFrom:1 to:1 with:'123456' startingAt:2
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   296
    "
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   297
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   298
    "Created: / 26-03-2019 / 12:10:26 / Claus Gittinger"
4920
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   299
! !
8c94a1a0ed25 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4512
diff changeset
   300
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
!FourByteString methodsFor:'queries'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
bitsPerCharacter
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
    "return the number of bits each character has.
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
     Here, 32 is returned (storing quad byte characters)."
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    ^ 32
2865
6f8b04862cc9 class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 1415
diff changeset
   308
!
6f8b04862cc9 class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 1415
diff changeset
   309
3826
63c5834d27c1 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3805
diff changeset
   310
bytesPerCharacter
63c5834d27c1 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3805
diff changeset
   311
    "return the number of bytes each character has.
63c5834d27c1 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3805
diff changeset
   312
     Here, 4 is returned (storing quad byte characters)."
63c5834d27c1 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3805
diff changeset
   313
63c5834d27c1 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3805
diff changeset
   314
    ^ 4
63c5834d27c1 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3805
diff changeset
   315
!
63c5834d27c1 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3805
diff changeset
   316
2865
6f8b04862cc9 class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 1415
diff changeset
   317
isWideString
3805
9cb0780df5fc #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3586
diff changeset
   318
    "true if I require more than one byte per character"
9cb0780df5fc #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3586
diff changeset
   319
2865
6f8b04862cc9 class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 1415
diff changeset
   320
    ^ true
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
4511
d7c52631ad33 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3840
diff changeset
   323
!FourByteString methodsFor:'testing'!
d7c52631ad33 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3840
diff changeset
   324
4512
0d6157b7ce6e #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
   325
isSingleByteCollection
0d6157b7ce6e #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
   326
    "return true, if the receiver has access methods for bytes;
0d6157b7ce6e #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
   327
     i.e. #at: and #at:put: accesses a byte and are equivalent to #byteAt: and byteAt:put:
0d6157b7ce6e #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
   328
     and #replaceFrom:to: is equivalent to #replaceBytesFrom:to:. 
0d6157b7ce6e #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
   329
     false is returned here since at: returns 4-byte characters and not bytes 
0d6157b7ce6e #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
   330
      - the method is redefined from UninterpretedBytes."
0d6157b7ce6e #BUGFIX by stefan
Stefan Vogel <sv@exept.de>
parents: 4511
diff changeset
   331
4511
d7c52631ad33 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3840
diff changeset
   332
    ^ false
d7c52631ad33 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3840
diff changeset
   333
d7c52631ad33 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3840
diff changeset
   334
    "Created: / 30-08-2017 / 23:31:02 / cg"
d7c52631ad33 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3840
diff changeset
   335
! !
d7c52631ad33 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3840
diff changeset
   336
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
!FourByteString class methodsFor:'documentation'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
version
3586
a6d20359cdf4 class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 3533
diff changeset
   340
    ^ '$Header$'
4922
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   341
!
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   342
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   343
version_CVS
ff7afd151379 #TUNING by cg
Claus Gittinger <cg@exept.de>
parents: 4920
diff changeset
   344
    ^ '$Header$'
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   345
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   346
3533
1465b5fed73e class: FourByteString
Stefan Vogel <sv@exept.de>
parents: 2865
diff changeset
   347
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   348
FourByteString initialize!