BitMasks
Documentation for BitMasks.
BitMasks.combination_pairs — Functioncombination_pairs(T::Type{<:BitMask})Return a vector of name => combination::T pairs for all values of type T that that do not define a new flag, but rather define combinations of flags.
See also: combinations
BitMasks.combinations — Functioncombinations(T::Type{<:BitMask})Return a vector of values of type T that do not define a new flag, but rather define combinations of flags.
BitMasks.enabled_flags — MethodReturn the bitmask flags present in mask; that is, all the BitMask flags for which in(flag, mask).
BitMasks.@bitmask — Macro@bitmask [exported = false] BitFlags::UInt32 begin
FLAG_A = 1
FLAG_B = 2
FLAG_C = 2^2 # == 4 (if you didn't know)
FLAG_AB = FLAG_A | FLAG_B
end
@bitmask [exported = false] BitFlags::UInt32 begin
FLAG_A = 1
FLAG_B # unspecified, will have the mask after 0x01, i.e. 0x02.
FLAG_C = 4
FLAG_AB = FLAG_A | FLAG_B
endEnumeration of bitmask flags that can be combined with &, | and xor, forbidding the combination of flags from different BitMasks.
If exported is set to true with a first argument of the form exported = <false|true>, then all the values and the defined type will be exported.
If a flag is left unspecified, it will inherit the value after the previous declaration that is not a combination of other flags.
If there are any unspecified flags, all non-combination values should be declared in an ascending order to guarantee that the flags generated automatically will not alias another one.