frost.core

Class Char8

    └ Value
         └ Immutable
             └ Object

Implemented Interfaces:

Depending on context, represents either a Unicode codepoint in the range 0 to 255 or a single byte of a UTF-8 encoded string. For ASCII characters (0 to 127), there is no difference between the two interpretations.

A single-codepoint string literal whose single codepoint fits into a Char8 (that is, Unicode codepoints 0 to 255) may be used wherever a Char8 is expected. That is, it is legal to write:

def c:Char8 := "A"
Source Code:
View Source

Class Method Summary

-- multiply operator --
*(count:Int, char:Char8):String
Returns a string consisting of count copies of the given character.

Initializer Summary

init(value:UInt8):Char8
Creates a Char16 with the specified codepoint.

Field Summary

isWhitespace:Bit
true if this character is whitespace.
isDigit:Bit
true if this character is a numeric digit.
asChar16:Char16
This character converted to a Char16.
asChar32:Char32
This character converted to a Char32.
asInt8:Int8
This character's codepoint converted to an 8 bit signed number.
asInt16:Int16
This character's codepoint converted to a 16 bit signed number.
asInt32:Int32
This character's codepoint converted to a 32 bit signed number.
asInt64:Int64
This character's codepoint converted to a 64 bit signed number.
asInt:Int
This character's codepoint converted to an Int.
asUInt8:UInt8
This character's codepoint converted to an 8 bit unsigned number.
asUInt16:UInt16
This character's codepoint converted to a 16 bit unsigned number.
asUInt32:UInt32
This character's codepoint converted to a 32 bit unsigned number.
asUInt64:UInt64
This character's codepoint converted to a 64 bit unsigned number.
asUInt:UInt
This character's codepoint converted to a UInt.
toChar16:Char16
This character converted to a Char32.
toChar32:Char32
This character converted to a Char32.
toInt8:Int8
This character's codepoint converted to an 8 bit signed number.
toInt16:Int16
This character's codepoint converted to a 16 bit signed number.
toInt32:Int32
This character's codepoint converted to a 32 bit signed number.
toInt64:Int64
This character's codepoint converted to a 64 bit signed number.
toInt:Int
This character's codepoint converted to an Int.
toUInt8:UInt8
This character's codepoint converted to an 8 bit unsigned number.
toUInt16:UInt16
This character's codepoint converted to a 16 bit unsigned number.
toUInt32:UInt32
This character's codepoint converted to a 32 bit unsigned number.
toUInt64:UInt64
This character's codepoint converted to a 64 bit unsigned number.
toUInt:UInt
This character's codepoint converted to a UInt.
Inherited Fields:

Instance Method Summary

-- subtract operator --
-(other:Char8):UInt8
Returns the difference between the codepoints of two Char8s.
-- subtract operator --
-(other:Char8):Int
Returns the difference between the codepoints of two Char8s.
-- equals operator --
=(other:Char8):Bit
Returns true if these objects are equal.
-- not equal operator --
!=(other:Char8):Bit
Returns true if these objects are not equal.
-- less than operator --
<(other:Char8):Bit
-- greater than operator --
>(other:Char8):Bit
-- less than or equal operator --
<=(other:Char8):Bit
-- greater than or equal operator --
>=(other:Char8):Bit
-- multiply operator --
*(count:Int):String
Returns a string consisting of count copies of this character.

Initializers

init (value:UInt8
):Char8

Creates a Char16 with the specified codepoint.

Parameters:
value - value of type UInt8

Fields

property isWhitespace:Bit

true if this character is whitespace.

property isDigit:Bit

true if this character is a numeric digit.

property asChar16:Char16

This character converted to a Char16.

property asChar32:Char32

This character converted to a Char32.

property asInt8:Int8

This character's codepoint converted to an 8 bit signed number. If this number is not in the range of an 8 bit signed number, a safety violation occurs.

property asInt16:Int16

This character's codepoint converted to a 16 bit signed number.

property asInt32:Int32

This character's codepoint converted to a 32 bit signed number.

property asInt64:Int64

This character's codepoint converted to a 64 bit signed number.

property asInt:Int

This character's codepoint converted to an Int.

property asUInt8:UInt8

This character's codepoint converted to an 8 bit unsigned number.

property asUInt16:UInt16

This character's codepoint converted to a 16 bit unsigned number.

property asUInt32:UInt32

This character's codepoint converted to a 32 bit unsigned number.

property asUInt64:UInt64

This character's codepoint converted to a 64 bit unsigned number.

property asUInt:UInt

This character's codepoint converted to a UInt.

property toChar16:Char16

This character converted to a Char32.

property toChar32:Char32

This character converted to a Char32.

property toInt8:Int8

This character's codepoint converted to an 8 bit signed number. If the character's codepoint does not fit into an 8 bit signed number, it will silently overflow.

property toInt16:Int16

This character's codepoint converted to a 16 bit signed number.

property toInt32:Int32

This character's codepoint converted to a 32 bit signed number.

property toInt64:Int64

This character's codepoint converted to a 64 bit signed number.

property toInt:Int

This character's codepoint converted to an Int.

property toUInt8:UInt8

This character's codepoint converted to an 8 bit unsigned number.

property toUInt16:UInt16

This character's codepoint converted to a 16 bit unsigned number.

property toUInt32:UInt32

This character's codepoint converted to a 32 bit unsigned number.

property toUInt64:UInt64

This character's codepoint converted to a 64 bit unsigned number.

property toUInt:UInt

This character's codepoint converted to a UInt.

Class Methods

-- multiply operator --
@class
function * (count:Int,
 char:Char8
):String

Returns a string consisting of count copies of the given character.

Parameters:
count - value of type Int
char - value of type Char8

Instance Methods

-- subtract operator --
function - (other:Char8
):UInt8

Returns the difference between the codepoints of two Char8s.

Parameters:
other - value of type Char8
-- subtract operator --
function - (other:Char8
):Int

Returns the difference between the codepoints of two Char8s.

Parameters:
other - value of type Char8
-- equals operator --
@override
function = (other:Char8
):Bit

Returns true if these objects are equal.

Parameters:
other - value of type Char8
Overrides:
frost.core.Equatable.=
-- not equal operator --
@override
function != (other:Char8
):Bit

Returns true if these objects are not equal.

Parameters:
other - value of type Char8
Overrides:
frost.core.Equatable.!=
-- less than operator --
@override
function < (other:Char8
):Bit
Parameters:
other - value of type Char8
-- greater than operator --
@override
function > (other:Char8
):Bit
Parameters:
other - value of type Char8
-- less than or equal operator --
@override
function <= (other:Char8
):Bit
Parameters:
other - value of type Char8
-- greater than or equal operator --
@override
function >= (other:Char8
):Bit
Parameters:
other - value of type Char8
-- multiply operator --
function * (count:Int
):String

Returns a string consisting of count copies of this character.

Parameters:
count - value of type Int