Unicode32String.st
changeset 5433 45176601c636
parent 5265 5f6a992925c2
equal deleted inserted replaced
5432:60308c7e388d 5433:45176601c636
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 2004 by eXept Software AG 
     2  COPYRIGHT (c) 2004 by eXept Software AG 
     5               All Rights Reserved
     3               All Rights Reserved
     6 
     4 
     7  This software is furnished under a license and may be used
     5  This software is furnished under a license and may be used
    77         ^ super readFrom:aStreamOrString onError:exceptionBlock
    75         ^ super readFrom:aStreamOrString onError:exceptionBlock
    78     ].
    76     ].
    79     ^ self readSmalltalkStringFrom:aStreamOrString onError:exceptionBlock
    77     ^ self readSmalltalkStringFrom:aStreamOrString onError:exceptionBlock
    80 
    78 
    81     "
    79     "
    82         self readFrom:'abcäöü' storeString
    80         self readFrom:'abcäöü' storeString
    83         String readFrom:'abcäöü' storeString
    81         String readFrom:'abcäöü' storeString
    84     "
    82     "
    85 ! !
    83 ! !
    86 
    84 
    87 
    85 
    88 !Unicode32String methodsFor:'conversion'!
    86 !Unicode32String methodsFor:'conversion'!
   151         String streamContents:[:s|
   149         String streamContents:[:s|
   152             'hello' asUnicode32String storeOn:s
   150             'hello' asUnicode32String storeOn:s
   153         ].
   151         ].
   154 
   152 
   155         String streamContents:[:s|
   153         String streamContents:[:s|
   156             'hello -öäüß' asUnicode32String storeOn:s
   154             'hello -öäüß' asUnicode32String storeOn:s
   157         ].
   155         ].
   158     "
   156     "
   159 
   157 
   160 "/    aStream nextPut:$'.
   158 "/    aStream nextPut:$'.
   161 "/    (self includes:$') ifTrue:[
   159 "/    (self includes:$') ifTrue:[
   181         ^ self asSingleByteString storeString.
   179         ^ self asSingleByteString storeString.
   182     ].
   180     ].
   183 
   181 
   184     "
   182     "
   185         'hello' asUnicode32String storeString
   183         'hello' asUnicode32String storeString
   186         'hello -öäüß' storeString
   184         'hello -öäüß' storeString
   187         'hello -öäüß' asUnicode32String storeString
   185         'hello -öäüß' asUnicode32String storeString
   188     "
   186     "
   189 !
   187 !
   190 
   188 
   191 unicodeStoreOn:aStream
   189 unicodeStoreOn:aStream
   192     "put the storeString of myself on aStream"
   190     "put the storeString of myself on aStream"
   211     ^ self basicStoreString.
   209     ^ self basicStoreString.
   212 ! !
   210 ! !
   213 
   211 
   214 !Unicode32String methodsFor:'testing'!
   212 !Unicode32String methodsFor:'testing'!
   215 
   213 
       
   214 isLiteral
       
   215     "return true, if the receiver can be used as a literal constant in ST syntax
       
   216      (i.e. can be used in constant arrays)"
       
   217 
       
   218     ^ true
       
   219 !
       
   220 
   216 isUnicode32String
   221 isUnicode32String
   217     "true if this is a 4-byte unicode string"
   222     "true if this is a 4-byte unicode string"
   218 
   223 
   219     ^ true
   224     ^ true
   220 !
   225 !