bitflag

package
v0.0.0-...-5f41422 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2018 License: BSD-3-Clause Imports: 0 Imported by: 0

README

bitflag

Go Report Card GoDoc

Package bitflag provides simple bit flag setting, checking, and clearing methods that take bit position args as ints (from const int eunum iota's) and do the bit shifting from there -- although a tiny bit slower, the convenience of maintaining ordinal lists of bit positions greatly outweighs that cost -- see kit type registry for further enum management functions

Documentation

Overview

package bitflag provides simple bit flag setting, checking, and clearing methods that take bit position args as ints (from const int eunum iota's) and do the bit shifting from there -- although a tiny bit slower, the convenience of maintaining ordinal lists of bit positions greatly outweighs that cost -- see kit type registry for further enum management functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(bits *int64, flags ...int)

clear bit value(s) for ordinal bit position flags

func Clear32

func Clear32(bits *int32, flags ...int)

clear bit value(s) for ordinal bit position flags

func ClearMask

func ClearMask(bits *int64, mask int64)

clear all of the bits in the mask

func ClearMask32

func ClearMask32(bits *int32, mask int32)

clear all of the bits in the mask

func Has

func Has(bits int64, flag int) bool

check if given bit value is set for ordinal bit position flag

func Has32

func Has32(bits int32, flag int) bool

check if given bit value is set for ordinal bit position flag

func HasAll

func HasAll(bits int64, flags ...int) bool

check if all of a set of flags are set for ordinal bit position flags (logical AND)

func HasAll32

func HasAll32(bits int32, flags ...int) bool

check if all of a set of flags are set for ordinal bit position flags

func HasAny

func HasAny(bits int64, flags ...int) bool

check if any of a set of flags are set for ordinal bit position flags (logical OR)

func HasAny32

func HasAny32(bits int32, flags ...int) bool

check if any of a set of flags are set for ordinal bit position flags

func HasMask

func HasMask(bits, mask int64) bool

check if any of the bits in mask are set

func HasMask32

func HasMask32(bits, mask int32) bool

check if any of the bits in mask are set

func Mask

func Mask(flags ...int) int64

make a mask for checking multiple different flags

func Mask32

func Mask32(flags ...int) int32

make a mask for checking multiple different flags

func Set

func Set(bits *int64, flags ...int)

set bit value(s) for ordinal bit position flags

func Set32

func Set32(bits *int32, flags ...int)

set bit value(s) for ordinal bit position flags

func SetState

func SetState(bits *int64, state bool, flags ...int)

set or clear bit value(s) depending on state (on / off) for ordinal bit position flags

func SetState32

func SetState32(bits *int32, state bool, flags ...int)

set or clear bit value(s) depending on state (on / off) for ordinal bit position flags

func Toggle

func Toggle(bits *int64, flags ...int)

toggle state of bit value(s) for ordinal bit position flags

func Toggle32

func Toggle32(bits *int32, flags ...int)

toggle state of bit value(s) for ordinal bit position flags

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL