Skip to content

Latest commit

 

History

History
151 lines (81 loc) · 2.92 KB

bitflag.md

File metadata and controls

151 lines (81 loc) · 2.92 KB

bitflag

import "github.com/andy2046/gopie/pkg/bitflag"

Package bitflag implements bit flag.

bitflag.go

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 (*Flag) Clear

func (f *Flag) Clear(n uint8)

Clear clear a single bit at n. n should be less than 8.

func (*Flag) ClearAll

func (f *Flag) ClearAll(opts ...Flag)

ClearAll clear all the flags.

func (Flag) IsAnySet

func (f Flag) IsAnySet(opts ...Flag) bool

IsAnySet check if any one flag is set.

func (Flag) IsSet

func (f Flag) IsSet(n uint8) bool

IsSet check if the bit at n is set. n should be less than 8.

func (*Flag) Reset

func (f *Flag) Reset()

Reset reset the flag.

func (*Flag) Set

func (f *Flag) Set(n uint8)

Set set a single bit at n. n should be less than 8.

func (*Flag) SetAll

func (f *Flag) SetAll(opts ...Flag)

SetAll set all the flags.

func (*Flag) Toggle

func (f *Flag) Toggle(n uint8)

Toggle toggle (XOR) a single bit at n. n should be less than 8.

func (*Flag) ToggleAll

func (f *Flag) ToggleAll(opts ...Flag)

ToggleAll toggle (XOR) all the flags.


Generated by godoc2md