import "github.com/andy2046/gopie/pkg/bitflag"
Package bitflag implements bit flag.
- type Flag
- func (f Flag) AreAllSet(opts ...Flag) bool
- func (f *Flag) Clear(n uint8)
- func (f *Flag) ClearAll(opts ...Flag)
- func (f Flag) IsAnySet(opts ...Flag) bool
- func (f Flag) IsSet(n uint8) bool
- func (f *Flag) Reset()
- func (f *Flag) Set(n uint8)
- func (f *Flag) SetAll(opts ...Flag)
- func (f *Flag) Toggle(n uint8)
- func (f *Flag) ToggleAll(opts ...Flag)
type Flag byte
Flag is an 8 bits flag.
func (f Flag) AreAllSet(opts ...Flag) bool
AreAllSet check if all the flags are set.
func (f *Flag) Clear(n uint8)
Clear clear a single bit at n
.
n
should be less than 8
.
func (f *Flag) ClearAll(opts ...Flag)
ClearAll clear all the flags.
func (f Flag) IsAnySet(opts ...Flag) bool
IsAnySet check if any one flag is set.
func (f Flag) IsSet(n uint8) bool
IsSet check if the bit at n
is set.
n
should be less than 8
.
func (f *Flag) Reset()
Reset reset the flag.
func (f *Flag) Set(n uint8)
Set set a single bit at n
.
n
should be less than 8
.
func (f *Flag) SetAll(opts ...Flag)
SetAll set all the flags.
func (f *Flag) Toggle(n uint8)
Toggle toggle (XOR) a single bit at n
.
n
should be less than 8
.
func (f *Flag) ToggleAll(opts ...Flag)
ToggleAll toggle (XOR) all the flags.
Generated by godoc2md