5#include "qx/core/qx_core_export.h"
18 BitArray(
int size,
bool value =
false);
23 requires std::integral<T>
26 int bitCount =
sizeof(T)*8;
30 for(
int i = 0; i < bitCount; ++i)
31 if(integer & 0b1 << i)
40 requires std::integral<T>
43 int bitCount =
sizeof(T)*8;
46 for(
int i = 0; i < bitCount && i < count(); ++i)
47 integer |= (testBit(i) ? 0b1 : 0b0) << i;
54 void append(
bool bit =
false);
55 void replace(
const BitArray& bits,
int start = 0,
int length = -1);
58 requires std::integral<T>
59 void replace(T integer,
int start = 0,
int length = -1)
61 BitArray converted = BitArray::fromInteger(integer);
62 replace(converted, start,
length);
65 BitArray subArray(
int start,
int length = -1);
66 BitArray takeFromStart(
int length = -1);
67 BitArray takeFromEnd(
int length = -1);
70 void operator<<=(
int n);
72 void operator>>=(
int n);
74 void operator+=(
const BitArray& rhs);
The BitArray class is a more robust variant of QBitArray, which provides an array of bits.
Definition qx-bitarray.h:14
void replace(T integer, int start=0, int length=-1)
Definition qx-bitarray.h:59
T toInteger()
Definition qx-bitarray.h:41
static BitArray fromInteger(const T &integer)
Definition qx-bitarray.h:24
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-processwaiter.cpp:5
T length(T start, T end)
Definition qx-algorithm.h:29