Unicode32String.st
author Claus Gittinger <cg@exept.de>
Fri, 17 May 2019 13:10:48 +0200
changeset 4944 f4f8254bfb3b
parent 3872 af31f9e3a160
child 4769 89914ccfcf7d
child 4965 cb05c61f9204
permissions -rw-r--r--
#DOCUMENTATION by cg class: Socket class comment/format in: #newTCP: #newTCPserverAtPort:
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
"
1411
1cb88c3dbd22 encoding now unicode
Claus Gittinger <cg@exept.de>
parents: 1404
diff changeset
    12
"{ Package: 'stx:libbasic2' }"
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
3663
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
    14
"{ NameSpace: Smalltalk }"
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
    15
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
FourByteString variableLongSubclass:#Unicode32String
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
!Unicode32String 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
!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
documentation
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
"
1573
dec4f78e857b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    43
    Not yet fully finished - unicode support is still being implemented.
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
!Unicode32String class methodsFor:'initialization'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
initialize
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    "initialize the class - private"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    self flags:(Behavior flagLongs)
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    "
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
     Unicode32String initialize
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
    "
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    "Created: 30.6.1997 / 15:35:52 / cg"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
    "Modified: 30.6.1997 / 15:39:21 / cg"
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
2052
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    62
!Unicode32String class methodsFor:'reading'!
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    63
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    64
readFrom:aStreamOrString onError:exceptionBlock
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    65
    "read & return the next String from the (character-)stream aStream;
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    66
     skipping all whitespace first; return the value of exceptionBlock,
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    67
     if no string can be read. The sequence of characters as read from the
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    68
     stream must be one as stored via storeOn: or storeString."
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    69
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    70
    "
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    71
     this method is not to be inherited
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    72
     (i.e. not ok for subclasses; Symbol, for example)
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    73
    "
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    74
    self ~~ Unicode32String ifTrue:[
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    75
        ^ super readFrom:aStreamOrString onError:exceptionBlock
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    76
    ].
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    77
    ^ self readSmalltalkStringFrom:aStreamOrString onError:exceptionBlock
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    78
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    79
    "
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    80
        self readFrom:'abcäöü' storeString
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    81
        String readFrom:'abcäöü' storeString
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    82
    "
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    83
! !
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    84
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
    85
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
!Unicode32String methodsFor:'conversion'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
1443
e971d86d6259 Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents: 1411
diff changeset
    88
asUnicode32String
1573
dec4f78e857b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    89
    "as the receiver already is a unicode-32 string, return it"
dec4f78e857b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    90
1443
e971d86d6259 Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents: 1411
diff changeset
    91
    ^ self
e971d86d6259 Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents: 1411
diff changeset
    92
!
e971d86d6259 Define #asUnicode16String and #asUnicode32String
Stefan Vogel <sv@exept.de>
parents: 1411
diff changeset
    93
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
asUnicodeString
1573
dec4f78e857b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    95
    "as the receiver already is a unicode string, return it"
dec4f78e857b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
    96
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
    ^ self
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
printOn:aStream
2052
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   101
    "print the receiver on aStream. 
3065
8488543e42fa class: Unicode32String
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
   102
     Let aStream decide how to represent this, whether utf8, ucs16, ..."
2052
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   103
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   104
    aStream nextPutAllUnicode:self
3065
8488543e42fa class: Unicode32String
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
   105
8488543e42fa class: Unicode32String
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
   106
    "Modified (comment): / 27-07-2013 / 15:37:03 / cg"
2052
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   107
! !
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   108
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   109
!Unicode32String methodsFor:'printing & storing'!
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   110
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   111
storeOn:aStream
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   112
    "put the storeString of myself on aStream"
1573
dec4f78e857b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1460
diff changeset
   113
3663
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   114
    self containsNon7BitAscii ifTrue:[
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   115
        "non-7bit string has been utf8Encoded"
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   116
        self utf8Encoded storeOn:aStream.
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   117
        aStream nextPutAll:' utf8Decoded'.
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   118
    ] ifFalse:[
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   119
        self asSingleByteString storeOn:aStream.
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   120
    ].
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   121
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   122
    "
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   123
        String streamContents:[:s|
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   124
            'hello' asUnicode32String storeOn:s
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   125
        ].
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   126
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   127
        String streamContents:[:s|
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   128
            'hello -öäüß' asUnicode32String storeOn:s
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   129
        ].
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   130
    "
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   131
2664
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   132
"/    aStream nextPut:$'.
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   133
"/    (self includes:$') ifTrue:[
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   134
"/        self do:[:thisChar |
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   135
"/            (thisChar == $') ifTrue:[aStream nextPut:thisChar].
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   136
"/            aStream nextPutUnicode:thisChar
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   137
"/        ]
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   138
"/    ] ifFalse:[
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   139
"/        aStream nextPutAllUnicode:self
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   140
"/    ].
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   141
"/    aStream nextPut:$'
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   142
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   143
    "Modified: / 28-09-2011 / 16:18:43 / cg"
2052
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   144
!
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   145
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   146
storeString
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   147
    "return a String for storing myself"
80b8a0c74063 Unicode handling:
Stefan Vogel <sv@exept.de>
parents: 2048
diff changeset
   148
3663
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   149
    self containsNon7BitAscii ifTrue:[
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   150
        "non-7bit string has been utf8Encoded"
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   151
        ^ (self utf8Encoded storeString),' utf8Decoded'.
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   152
    ] ifFalse:[
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   153
        ^ self asSingleByteString storeString.
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   154
    ].
2664
8c8745eac73d unicode storestring fixed
Claus Gittinger <cg@exept.de>
parents: 2052
diff changeset
   155
3663
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   156
    "
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   157
        'hello' asUnicode32String storeString
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   158
        'hello -öäüß' storeString
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   159
        'hello -öäüß' asUnicode32String storeString
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   160
    "
2740
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   161
!
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   162
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   163
unicodeStoreOn:aStream
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   164
    "put the storeString of myself on aStream"
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   165
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   166
    aStream nextPut:$'.
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   167
    (self includes:$') ifTrue:[
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   168
        self do:[:thisChar |
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   169
            (thisChar == $') ifTrue:[aStream nextPut:thisChar].
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   170
            aStream nextPutUnicode:thisChar
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   171
        ]
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   172
    ] ifFalse:[
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   173
        aStream nextPutAllUnicode:self
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   174
    ].
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   175
    aStream nextPut:$'
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   176
!
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   177
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   178
unicodeStoreString
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   179
    "return a UnicodeString for storing myself.
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   180
     This method is a kind of kludge.
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   181
     Use it when you want to write a storeString to an encoded Stream"
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   182
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   183
    ^ self basicStoreString.
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   184
! !
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   185
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   186
!Unicode32String methodsFor:'testing'!
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   187
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   188
isUnicode32String
3872
af31f9e3a160 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3871
diff changeset
   189
    "true if this is a 4-byte unicode string"
af31f9e3a160 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 3871
diff changeset
   190
2740
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   191
    ^ true
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   192
!
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   193
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   194
isUnicodeString
3871
4840a5481281 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
   195
    "true if this is a 2- or 4-byte unicode string
4840a5481281 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
   196
     (i.e. not a single byte string).
4840a5481281 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
   197
     Notice, that the name is misleading: 
4840a5481281 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
   198
     all strings are use unicode encoding"
4840a5481281 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3663
diff changeset
   199
2740
Stefan Vogel <sv@exept.de>
parents: 2709
diff changeset
   200
    ^ true
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
!Unicode32String class methodsFor:'documentation'!
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
version
3663
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   206
    ^ '$Header$'
2709
0d45ae840f12 backward compatibility storestring
Claus Gittinger <cg@exept.de>
parents: 2708
diff changeset
   207
!
0d45ae840f12 backward compatibility storestring
Claus Gittinger <cg@exept.de>
parents: 2708
diff changeset
   208
0d45ae840f12 backward compatibility storestring
Claus Gittinger <cg@exept.de>
parents: 2708
diff changeset
   209
version_CVS
3663
2c9a059e292d #REFACTORING
Stefan Vogel <sv@exept.de>
parents: 3454
diff changeset
   210
    ^ '$Header$'
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
! !
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
3065
8488543e42fa class: Unicode32String
Claus Gittinger <cg@exept.de>
parents: 2740
diff changeset
   213
1404
776eb9467dc3 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
Unicode32String initialize!