blob: 1909d9ba7350128bb04fa1e6c6f51524f004ce66 [file] [log] [blame]
// WARNING: This file is machine generated by fidlgen.
// fidl_experiment = output_index_json
package bitsconstants
import (
_strings "strings"
_bindings "syscall/zx/fidl"
)
const (
Const0 BitsType = 0
Const1 BitsType = BitsTypeA
Const2 BitsType = 129
Const3 BitsType = 131
)
var _ _bindings.Bits = BitsType(0)
type BitsType uint32
const (
BitsTypeA BitsType = 1
BitsTypeB BitsType = 128
BitsTypeC BitsType = 2
BitsType_Mask BitsType = 131
)
func (_ BitsType) I_BitsMask() BitsType {
return BitsType_Mask
}
func (_ BitsType) I_BitsIsStrict() bool {
return true
}
func (x BitsType) HasUnknownBits() bool {
return x.GetUnknownBits() != 0
}
func (x BitsType) GetUnknownBits() uint64 {
return uint64(^BitsType_Mask & x)
}
func (x BitsType) InvertBits() BitsType {
return BitsType_Mask & ^x
}
// HasBits validates that all flipped bits in the mask are set.
func (x BitsType) HasBits(mask BitsType) bool {
return mask|x == x
}
// ClearBits ensures all flipped bits in the mask are unset.
func (x BitsType) ClearBits(mask BitsType) BitsType {
return ^mask & x
}
func (x BitsType) String() string {
var buf _strings.Builder
if 1&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("A")
}
if 128&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("B")
}
if 2&x != 0 {
if buf.Len() != 0 {
buf.WriteRune('|')
}
buf.WriteString("C")
}
if buf.Len() == 0 {
buf.WriteString("<empty bits>")
}
return buf.String()
}