FourByteString.st
author Stefan Vogel <sv@exept.de>
Thu, 08 Nov 2007 15:03:14 +0100
changeset 1908 7d5c6c7d805f
parent 1415 3ef6a2c42611
child 2865 6f8b04862cc9
permissions -rw-r--r--
Methods to get all addresses for a given hostname (multihomed hosts)

"
 COPYRIGHT (c) 2004 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"

"{ Package: 'stx:libbasic2' }"

CharacterArray variableLongSubclass:#FourByteString
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Collections-Text'
!

!FourByteString class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2004 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    FourByteStrings are like strings, but storing 32bits per character.
    The integration of them into the system is not completed ....

    [author:]
        Claus Gittinger

    [see also:]
        Text TwoByteString UnicodeEncodedString
        StringCollection
"
! !

!FourByteString class methodsFor:'initialization'!

initialize
    "initialize the class - private"

    self flags:(Behavior flagLongs)

    "
     FourByteString initialize
    "

    "Modified: 22.4.1996 / 16:14:14 / cg"
! !

!FourByteString class methodsFor:'instance creation'!

basicNew:anInteger
    "return a new empty string with anInteger characters"

    ^ (super basicNew:anInteger) atAllPut:(Character space)

    "Modified: 26.2.1996 / 14:38:47 / cg"
! !

!FourByteString methodsFor:'accessing'!

basicAt:index
    "return the character at position index, an Integer
     - reimplemented here since we return 32-bit characters"

    |val|

    val := super basicAt:index.
    ^ Character value:val
!

basicAt:index put:aCharacter
    "store the argument, aCharacter at position index, an Integer.
     Returns aCharacter (sigh).
     - reimplemented here since we store 32-bit characters"

    |val|

    val := aCharacter codePoint.
    super basicAt:index put:val.
    ^ aCharacter
! !

!FourByteString methodsFor:'queries'!

bitsPerCharacter
    "return the number of bits each character has.
     Here, 32 is returned (storing quad byte characters)."

    ^ 32
! !

!FourByteString class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/libbasic2/FourByteString.st,v 1.2 2004-03-05 19:02:31 stefan Exp $'
! !

FourByteString initialize!