Unicode16String.st
changeset 25203 a3ba0cf0dd07
parent 24940 476e387608cf
equal deleted inserted replaced
25202:a9947abc32f8 25203:a3ba0cf0dd07
     1 "{ Encoding: utf8 }"
       
     2 
       
     3 "
     1 "
     4  COPYRIGHT (c) 1997 by eXept Software AG 
     2  COPYRIGHT (c) 1997 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
    81         ^ super readFrom:aStreamOrString onError:exceptionBlock
    79         ^ super readFrom:aStreamOrString onError:exceptionBlock
    82     ].
    80     ].
    83     ^ self readSmalltalkStringFrom:aStreamOrString onError:exceptionBlock
    81     ^ self readSmalltalkStringFrom:aStreamOrString onError:exceptionBlock
    84 
    82 
    85     "
    83     "
    86         self readFrom:'abcäöü' storeString
    84         self readFrom:'abcäöü' storeString
    87     "
    85     "
    88 ! !
    86 ! !
    89 
    87 
    90 
    88 
    91 !Unicode16String methodsFor:'conversion'!
    89 !Unicode16String methodsFor:'conversion'!
   172         String streamContents:[:s|
   170         String streamContents:[:s|
   173             'hello' asUnicodeString storeOn:s
   171             'hello' asUnicodeString storeOn:s
   174         ].
   172         ].
   175 
   173 
   176         String streamContents:[:s|
   174         String streamContents:[:s|
   177             'hello -öäüß' asUnicodeString storeOn:s
   175             'hello -öäüß' asUnicodeString storeOn:s
   178         ].
   176         ].
   179     "
   177     "
   180 
   178 
   181 "/    aStream nextPut:$'.
   179 "/    aStream nextPut:$'.
   182 "/    (self includes:$') ifTrue:[
   180 "/    (self includes:$') ifTrue:[
   202         ^ self asSingleByteString storeString.
   200         ^ self asSingleByteString storeString.
   203     ].
   201     ].
   204 
   202 
   205     "
   203     "
   206         'hello' asUnicodeString storeString
   204         'hello' asUnicodeString storeString
   207         'hello -öäüß' storeString
   205         'hello -öäüß' storeString
   208         'hello -öäüß' asUnicodeString storeString
   206         'hello -öäüß' asUnicodeString storeString
   209     "
   207     "
   210 
   208 
   211     "Modified: / 25-01-2012 / 11:59:34 / cg"
   209     "Modified: / 25-01-2012 / 11:59:34 / cg"
   212 !
   210 !
   213 
   211 
   234     ^ self basicStoreString.
   232     ^ self basicStoreString.
   235 ! !
   233 ! !
   236 
   234 
   237 !Unicode16String methodsFor:'testing'!
   235 !Unicode16String methodsFor:'testing'!
   238 
   236 
       
   237 isLiteral
       
   238     "return true, if the receiver can be used as a literal constant in ST syntax
       
   239      (i.e. can be used in constant arrays)"
       
   240 
       
   241     ^ true
       
   242 !
       
   243 
   239 isUnicode16String
   244 isUnicode16String
   240     ^ true
   245     ^ true
   241 !
   246 !
   242 
   247 
   243 isUnicodeString
   248 isUnicodeString