Utf32View
Description
A <Utf32View> provides a bidirectional view over the unicode component as a collection of UTF-32 code units in platform-endian format. UTF-32 is a 32-bit fixed-length encoding that encodes unicode scalar values as a 32-bit code unit. This view is similar to <UnicodeScalarView> except that calls to #next will answer an <Integer> instead of a <UnicodeScalar> and the #contents collection will be a <Utf32>
#next/#previous - Answers a 32-bit <Integer>.
#contents - Answers a <Utf32>
Examples
| view |
view := Utf32View on: 'abc'.
self assert: [view next = $a value].
self assert: [view next = $b value].
self assert: [view next = $c value].
self assert: [view atEnd].
self assert: [view previous = $c value].
self assert: [view previous = $b value].
self assert: [view previous = $a value].
self assert: [view atStart].
self assert: [view contents asArray = { $a value. $b value. $c value}]
Class Methods
None
Instance Methods
None
Last modified date: 04/20/2022