Collaboration diagram for Bit Set Container:
|
Files | |
| file | psBitSet.h |
| Creates an array of bytes of arbitrary length for storing individual bits. | |
Data Structures | |
| struct | psBitSet |
| Struct containing array of bytes to hold bit data and corresponding array length. More... | |
Functions | |
| psBitSet * | psBitSetAlloc (psS32 n) |
| Allocate a psBitSet. | |
| psBitSet * | psBitSetSet (psBitSet *inMask, psS32 bit) |
| Set a bit. | |
| psBitSet * | psBitSetClear (psBitSet *inMask, psS32 bit) |
| Clear a bit. | |
| psBool | psBitSetTest (const psBitSet *inMask, psS32 bit) |
| Test the value of a bit. | |
| psBitSet * | psBitSetOp (psBitSet *outMask, const psBitSet *inMask1, char *operator, const psBitSet *inMask2) |
| Perform a binary operation on two psBitSets. | |
| psBitSet * | psBitSetNot (psBitSet *outBitSet, const psBitSet *inBitSet) |
| Perform a not operation on a psBitSet. | |
| char * | psBitSetToString (const psBitSet *inMask) |
| Convert the psBitSet to a string of ones and zeros. | |
|
|
Allocate a psBitSet. Create a psBitSet with the number of bits specified by the user. All bits are set to zero upon allocation.
|
|
||||||||||||
|
Clear a bit. Clear a bit at a given bit location. The bit is cleared based on a zero index with the first bit set in the zero bit slot of the zero element of the byte array.
|
|
||||||||||||
|
Perform a not operation on a psBitSet. Toggles bits in a psBitset. All zero bits are set to one and all one bits are set to zero.
|
|
||||||||||||||||||||
|
Perform a binary operation on two psBitSets. Perform an AND, OR, or XOR on two psBitSets. If the BitMasks are not the same size, the operation will not be performed and an error message will be logged.
|
|
||||||||||||
|
Set a bit. Sets a bit at a given bit location. The bit is set based on a zero index with the first bit set in the zero bit slot of the zero element of the byte array. As an example, setting bit 3 in an array with two elements would result in an psBitSet that looks like 00000000 00001000.
|
|
||||||||||||
|
Test the value of a bit. Prints the value of a bit at a given bit location, either one or zero. The resulting bit is based on a zero index format with the first bit set in the zero bit slot of the zero element of the byte array As an example, testing bit 3 in a psBitSet with two bytes that looks like 00000000 00001000 would return a value of one, since that is the value that was set.
|
|
|
Convert the psBitSet to a string of ones and zeros. Converts the contents of a psBitSet to a string representation of its binary form of ones and zeros. The LSB is the right-most chracter. Each set of eight characters represents one byte.
|
1.4.1