![]() |
PIP 5.5.3
Platform-Independent Primitives
|
The PIBitArray class provides an space-efficient array of bits. More...
#include <pibitarray.h>
Public Member Functions | |
| PIBitArray (const int &size=0) | |
| Constructs bit array with "size" size. | |
| PIBitArray (uchar val) | |
| Constructs bit array with size 8 and values from "val". | |
| PIBitArray (ushort val) | |
| Constructs bit array with size 16 and values from "val". | |
| PIBitArray (uint val) | |
| Constructs bit array with size 32 and values from "val". | |
| PIBitArray (ullong val) | |
| Constructs bit array with size 64 and values from "val". | |
| PIBitArray (const uchar *data, uint bytes) | |
| Constructs bit array with size "bytes * 8" and values from "data". | |
| uint | bitSize () const |
| Returns a size in bits. | |
| uint | byteSize () const |
| Returns a size in bytes. | |
| PIBitArray & | resize (const uint &size) |
| Resize this array to "size" bits. | |
| PIBitArray & | clearBit (const uint &index) |
| Set bit with index "index" to 0. | |
| PIBitArray & | setBit (const uint &index) |
| Set bit with index "index" to 1. | |
| PIBitArray & | writeBit (const uint &index, const bool &value) |
| Set bit with index "index" to "value". | |
| PIBitArray & | writeBit (const uint &index, const uchar &value) |
| Set bit with index "index" to "value". | |
| PIBitArray & | push_back (const bool &value) |
| Add bit with value "value" to the end of array. | |
| PIBitArray & | push_back (const uchar &value) |
| Add bit with value "value" to the end of array. | |
| PIBitArray & | insert (const uint &index, const bool &value) |
| Insert bit with value "value" after "index" position. | |
| PIBitArray & | insert (const uint &index, const uchar &value) |
| Insert bit with value "value" after "index" position. | |
| PIBitArray & | push_front (const bool &value) |
| Add bit with value "value" to the beginning of array. | |
| PIBitArray & | push_front (const uchar &value) |
| Add bit with value "value" to the beginning of array. | |
| PIBitArray & | pop_back () |
| Remove one bit from the end of array. | |
| PIBitArray & | pop_front () |
| Remove one bit from the beginning of array. | |
| PIBitArray & | append (const PIBitArray &ba) |
| Add bits "ba" to the end of array. | |
| uchar * | data () |
| Returns pointer to bytes data of array. | |
| uchar | toUChar () |
| Returns data of array as uchar. | |
| ushort | toUShort () |
| Returns data of array as ushort. | |
| uint | toUInt () |
| Returns data of array as uint. | |
| ullong | toULLong () |
| Returns data of array as ullong. | |
| bool | at (const uint &index) const |
| Returns bit value at index "index". | |
| bool | operator[] (const uint &index) const |
| Returns bit value at index "index". | |
| void | operator+= (const PIBitArray &ba) |
| Similar to append(). | |
| bool | operator== (const PIBitArray &ba) const |
| Returns if two bit arrays are similar. | |
| bool | operator!= (const PIBitArray &ba) const |
| Returns if two bit arrays are not similar. | |
| void | operator= (const uchar &val) |
| Resize and set values from "val". | |
| void | operator= (const ushort &val) |
| Resize and set values from "val". | |
| void | operator= (const uint &val) |
| Resize and set values from "val". | |
| void | operator= (const ullong &val) |
| Resize and set values from "val". | |
The PIBitArray class provides an space-efficient array of bits.