tp.Bf
tp.Bf is the Tripous bit-field helper. A bit-field is a single integer that stores
many boolean flags. Each flag must be a power of two: 1, 2,
4, 8, and so on. This is useful for options, permissions, state flags,
and enum-like sets.
The demo uses a small permission set. Read, Write, Delete,
and Export are separate flags. A user may have any combination of them, stored in
one integer value.
Permission flags
Select flags and build a single integer value using
tp.Bf.IntegerArrayToSetValue().
Current value
tp.Bf.SetToString() converts the integer value back to a readable
comma-delimited flag name list.
Set operations
Run the standard bit-field operations against sample values: user permissions and required permissions.
Membership and arrays
tp.Bf.In() and tp.Bf.Member() test whether all flags
from one value exist in another. The array helpers convert between a set value
and a list of integer flags.