Programmer Reference : UnicodeSupport : Utf32LittleEndianView
Utf32LittleEndianView
Description
A <Utf32LittleEndianView> provides a bidirectional view over the unicode component as a collection of UTF-32 code
units in little-endian format
#next/#previous - Answers an 32-bit <Integer>.
#contents - Answers a <Utf32LE>
Examples
| view leA leB leC |
view := Utf32LittleEndianView on: 'abc'.
self assert: [view next = (leA := (OSUInt32 new at: 0 put: $a value; yourself) leUint32At: 0)].
self assert: [view next = (leB := (OSUInt32 new at: 0 put: $b value; yourself) leUint32At: 0)].
self assert: [view next = (leC := (OSUInt32 new at: 0 put: $c value; yourself) leUint32At: 0)].
self assert: [view atEnd].
self assert: [view previous = (leC := (OSUInt32 new at: 0 put: $c value; yourself) leUint32At: 0)].
self assert: [view previous = (leB := (OSUInt32 new at: 0 put: $b value; yourself) leUint32At: 0)].
self assert: [view previous = (leA := (OSUInt32 new at: 0 put: $a value; yourself) leUint32At: 0)].
self assert: [view atStart].
self assert: [view contents asArray = { leA. leB. leC. }]
Class Methods
None
Instance Methods
None
Last modified date: 01/18/2023