flags

type flags < type

The base type of flag types.

meth flags(Name₁ is Value₁, ...): flags

Returns a new flags type Returns a new flags type, where Nameᵢ has value Valueᵢ.

let mode := flags(Read is 1, Write is 4, Execute is 32)
:> <<mode>>
mode::Read :> Read
mode::Read + mode::Write :> Write,Read
meth flags(Name₁: string, ...): flags

Returns a new flags type, where Nameᵢ has value \(2^{i-1}\).

let mode := flags("Read", "Write", "Execute") :> <<mode>>
mode::Read :> Read
mode::Read + mode::Write :> Write,Read
type flags::spec

A pair of flag sets for including and excluding flags.

meth (Arg₁: string::buffer):append(Arg₂: flags::spec)

TBD

type flags::value

An instance of a flags type.

meth (Flags₁: flags::value) + (Flags₂: flags::value): flags::value

Returns the union of Flags₁ and Flags₂. Flags₁ and Flags₂ must have the same flags type.

let mode := flags("Read", "Write", "Execute") :> <<mode>>
mode::Read + mode::Write :> Write,Read
meth (Flags₁: flags::value) - (Flags₂: flags::value): flags::value

Returns the difference of Flags₁ and Flags₂. Flags₁ and Flags₂ must have the same flags type.

let mode := flags("Read", "Write", "Execute") :> <<mode>>
mode("Read", "Write") - mode::Write :> Read
meth /(Flags: flags::value): flags::spec

TBD

meth (Flags₁: flags::value) / (Flags₂: flags::value): flags::spec

TBD

meth (Flags₁: flags::value) < (Flags₂: flags::value): flags::value

Returns the Flags₂ if it contains all of Flags₁. Flags₁ and Flags₂ must have the same flags type.

let mode := flags("Read", "Write", "Execute") :> <<mode>>
mode("Read", "Write") < mode("Read", "Write", "Execute")
:> Write,Read,Execute
mode("Read", "Write", "Execute") < mode("Read", "Write")
:> nil
meth (Flags₁: flags::value) <= (Flags₂: flags::value): flags::value

Returns the Flags₂ if it contains all of Flags₁. Flags₁ and Flags₂ must have the same flags type.

let mode := flags("Read", "Write", "Execute") :> <<mode>>
mode("Read", "Write") <= mode("Read", "Write", "Execute")
:> Write,Read,Execute
mode("Read", "Write", "Execute") <= mode("Read", "Write")
:> nil
meth (Flags₁: flags::value) > (Flags₂: flags::value): flags::value

Returns the Flags₂ if it is contained in Flags₁. Flags₁ and Flags₂ must have the same flags type.

let mode := flags("Read", "Write", "Execute") :> <<mode>>
mode("Read", "Write") > mode("Read", "Write", "Execute")
:> nil
mode("Read", "Write", "Execute") > mode("Read", "Write")
:> Write,Read
meth (Flags₁: flags::value) >= (Flags₂: flags::value): flags::value

Returns the Flags₂ if it is contained in Flags₁. Flags₁ and Flags₂ must have the same flags type.

let mode := flags("Read", "Write", "Execute") :> <<mode>>
mode("Read", "Write") >= mode("Read", "Write", "Execute")
:> nil
mode("Read", "Write", "Execute") >= mode("Read", "Write")
:> Write,Read
meth (Flags: flags::value):in(Spec: flags::spec)

TBD

meth list(Arg₁: flags::value)

TBD

meth (Arg₁: string::buffer):append(Arg₂: flags::value)

TBD