2021-08-25 15:34:33 +02:00
|
|
|
package internal
|
|
|
|
|
|
|
|
type Flag uint64
|
|
|
|
|
|
|
|
func (flag Flag) Has(other Flag) bool {
|
2022-04-24 12:26:22 +02:00
|
|
|
return flag&other != 0
|
2021-08-25 15:34:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (flag Flag) Set(other Flag) Flag {
|
|
|
|
return flag | other
|
|
|
|
}
|
|
|
|
|
|
|
|
func (flag Flag) Remove(other Flag) Flag {
|
|
|
|
flag &= ^other
|
|
|
|
return flag
|
|
|
|
}
|