class Bool

namespace sys.core.lang
class Bool

A class representing a boolean value.

It can only take as a value the following literal constants: `true` and `false`.

Constructors

this

this{string: String};

Brief

Parses a string an constructs an Bool based on it.

Parameters

string string to parse

Methods

Clamp

def Clamp(min: Bool, max: Bool);

Brief

Clamps the current mutable instance between `min` and `max`.

Parameters

min the minimum value
max the maximum value

Clamped

func Clamped(min: Bool, max: Bool): Int;

Brief

Returns the current instance clamped between `min` and `max`.

Parameters

min the minimum value
max the maximum value

Returns

the clamped value

ToString

func ToString(): String;

Brief

Converts the value to a Utf8 string.

Returns

the resulting string

@write

func @write(ref stream: Stream);
func @write(ref stream: Stream, format: OutputFormat);

Brief

Writes the value to an Utf8 text stream.

Can use an optional output format specifier.

Parameters

stream the output stream
format formatting information

@put

func @put(ref stream: Stream);

Brief

Writes the value to a binary stream as a 8 bit signed integer, 0 or 1.

Parameters

stream the output stream

@get

def @get(ref stream: Stream);

Brief

Reads a 8 bit signed integer and casts it to a Bool.

Parameters

stream the input stream

Constants

Min

const Min;

Brief

The minimum value for an Bool instance.


Max

const Max;

Brief

The maximum value for an Bool instance.


IsSigned

const IsSigned;

Brief

true if the numeric representation uses two's complement signed values, false otherwise.


IsInteger

const IsInteger;

Brief

true if the numeric representation is an integer, false if it is a floating point.