137 memset(c, value ? 0xff : 0,
d.
size());
139 if (value && size && size % 8)
140 *(c+1+size/8) &= (1 << (size%8)) - 1;
171 for (
int i = 0; i < len; ++i)
179 c += (((v & 0xfff000) >> 12) *
Q_UINT64_C(0x1001001001001) &
Q_UINT64_C(0x84210842108421)) % 0x1f;
188 c += (((v & 0xfff000) >> 12) *
Q_UINT64_C(0x1001001001001) &
Q_UINT64_C(0x84210842108421)) % 0x1f;
194 if (bits[len / 8] & (1 << ((len - 1) & 7)))
199 return on ? numBits :
size() - numBits;
223 memset(c + s, 0,
d.
size() - s);
225 *(c+1+size/8) &= (1 << (size%8)) - 1;
289 while (begin < end && begin & 0x7)
291 int len = end - begin;
296 memset(c + (begin >> 3) + 1, value ? 0xff : 0, s >> 3);
530 int n = other.
d.
size() -1 ;
531 int p =
d.
size() - 1 - n;
559 int n = other.
d.
size() - 1;
585 int n = other.
d.
size() - 1;
607 int n =
d.
size() - 1;
613 *(a2-1) &= (1 << (sz%8)) - 1;
755 #ifndef QT_NO_DATASTREAM 797 const quint32 Step = 8 * 1024 * 1024;
798 quint32 totalBytes = (len + 7) / 8;
801 while (allocated < totalBytes) {
803 ba.
d.
resize(allocated + blockSize + 1);
812 int paddingMask = ~((0x1 << (len & 0x7)) - 1);
813 if (paddingMask != ~0x0 && (ba.
d.
constData()[ba.
d.
size() - 1] & paddingMask)) {
822 #endif // QT_NO_DATASTREAM void clear()
Clears the contents of the bit array and makes it empty.
QBitArray operator^(const QBitArray &a1, const QBitArray &a2)
Returns a bit array that is the XOR of the bit arrays a1 and a2.
QBitArray()
Constructs an empty bit array.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
void setBit(int i)
Sets the bit at index position i to 1.
#define QT_END_NAMESPACE
This macro expands to.
char * data()
Returns a pointer to the data stored in the byte array.
long ASN1_INTEGER_get ASN1_INTEGER * a
void setStatus(Status status)
Sets the status of the data stream to the status given.
bool testBit(int i) const
Returns true if the bit at index position i is 1; otherwise returns false.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
QBitArray & operator &=(const QBitArray &)
QBitArray operator~() const
Returns a bit array that contains the inverted bits of this bit array.
bool fill(bool val, int size=-1)
Sets every bit in the bit array to value, returning true if successful; otherwise returns false...
#define QT_BEGIN_NAMESPACE
This macro expands to.
int readRawData(char *, int len)
Reads at most len bytes from the stream into s and returns the number of bytes read.
void resize(int size)
Resizes the bit array to size bits.
The QBitArray class provides an array of bits.
const char * constData() const
Returns a pointer to the data stored in the byte array.
QBitArray & operator|=(const QBitArray &)
Performs the OR operation between all bits in this bit array and other.
void resize(int size)
Sets the size of the byte array to size bytes.
int count() const
Same as size().
int size() const
Returns the number of bytes in this byte array.
The QDataStream class provides serialization of binary data to a QIODevice.
friend Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QBitArray &)
Writes bit array ba to stream out.
QBitArray operator|(const QBitArray &a1, const QBitArray &a2)
Returns a bit array that is the OR of the bit arrays a1 and a2.
static const KeyPair *const end
QBitArray & operator^=(const QBitArray &)
Performs the XOR operation between all bits in this bit array and other.
int size() const
Returns the number of bits stored in the bit array.
int writeRawData(const char *, int len)
Writes len bytes from s to the stream.
friend Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QBitArray &)
Reads a bit array into ba from stream in.
QBitArray operator&(const QBitArray &a1, const QBitArray &a2)
Returns a bit array that is the AND of the bit arrays a1 and a2.