82#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
129 *
c =
quint8(
size_t(storageSize) * 8 - logicalSize);
132 *(
c + 1 + logicalSize / 8) &= (1 << (logicalSize & 7)) - 1;
142 Q_ASSERT_X(
size >= 0,
"QBitArray::QBitArray",
"Size must be greater than or equal to 0.");
193 return on ? numBits :
size() - numBits;
210 Q_ASSERT_X(
size >= 0,
"QBitArray::resize",
"Size must be greater than or equal to 0.");
311 Q_ASSERT_X(
size >= 0,
"QBitArray::fromBits",
"Size must be greater than or equal to 0.");
470#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
535 *bytes.
ptr = *
d1.ptr;
537 *bytes.
ptr = *
d2.ptr;
541 result.data_ptr() = std::move(bytes);
556 Q_ASSERT(
out.data_ptr().size == 0 || !
out.data_ptr().needsDetach());
560 auto dst =
reinterpret_cast<uchar *
>(
out.data_ptr().data());
561 auto p1 =
reinterpret_cast<const uchar *
>(
d1.data());
562 auto p2 =
reinterpret_cast<const uchar *
>(
d2.data());
597template <
typename BitwiseOp>
static
611 bool detached1 = !
d1.needsDetach();
612 bool detached2 = !
d2.needsDetach();
613 if (!detached1 && !detached2)
618 if (detached1 && detached2) {
620 swap =
d1.allocatedCapacity() <
d2.allocatedCapacity();
621 }
else if (detached2) {
630template <
typename BitwiseOp>
static
740 if (
d.isDetached() ||
n == 0)
741 return std::move(
d.data_ptr());
744 dst =
reinterpret_cast<uchar *
>(tmp.data());
750 bitdiff =
dst[0] =
src[0];
755 if (
int tailCount = 16 - bitdiff; tailCount != 8) {
758 uchar tailMask = (1U << tailCount) - 1;
759 dst[
n - 1] &= tailMask;
888#ifndef QT_NO_DATASTREAM
900 if (
out.version() < QDataStream::Qt_6_0) {
902 out.setStatus(QDataStream::Status::SizeLimitExceeded);
926 if (
in.version() < QDataStream::Qt_6_0) {
930 in.setStatus(QDataStream::ReadCorruptData);
938 in.setStatus(QDataStream::Status::SizeLimitExceeded);
952 while (allocated < totalBytes) {
957 in.setStatus(QDataStream::ReadPastEnd);
963 const auto fromStream =
ba.d.back();
965 if (
ba.d.back() != fromStream) {
967 in.setStatus(QDataStream::ReadCorruptData);
974#ifndef QT_NO_DEBUG_STREAM
978 dbg.nospace() <<
"QBitArray(";
985 if (!(
i % 4) && (
i <
array.size()))
QBitArray & operator&=(QBitArray &&)
Performs the AND operation between all bits in this bit array and other.
bool fill(bool aval, qsizetype asize=-1)
Sets every bit in the bit array to value, returning true if successful; otherwise returns false.
qsizetype count() const
Same as size().
void setBit(qsizetype i)
Sets the bit at index position i to 1.
QBitArray & operator|=(QBitArray &&)
Performs the OR operation between all bits in this bit array and other.
void resize(qsizetype size)
Resizes the bit array to size bits.
static QBitArray fromBits(const char *data, qsizetype len)
quint32 toUInt32(QSysInfo::Endian endianness, bool *ok=nullptr) const noexcept
qsizetype size() const
Returns the number of bits stored in the bit array.
QBitArray() noexcept
Constructs an empty bit array.
QBitArray & operator^=(QBitArray &&)
Performs the XOR operation between all bits in this bit array and other.
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
iterator end()
Returns an \l{STL-style iterators}{STL-style iterator} pointing just after the last byte in the byte-...
void clear()
Clears the contents of the byte array and makes it null.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
\inmodule QtCore\reentrant
qsizetype size() const noexcept
Returns the number of characters in this string.
void swap(QString &other) noexcept
void resize(qsizetype size)
Sets the size of the string to size characters.
Endian
\value BigEndian Big-endian byte order (also called Network byte order) \value LittleEndian Little-en...
Combined button and popup list for selecting options.
Q_DECL_CONST_FUNCTION QT_POPCOUNT_CONSTEXPR uint qPopulationCount(quint32 v) noexcept
static constexpr qsizetype storage_size(qsizetype size)
static QBitArray sizedForOverwrite(const QBitArray &a1, const QBitArray &a2)
QBitArray operator^(const QBitArray &a1, const QBitArray &a2)
static constexpr qsizetype allocation_size(qsizetype size)
static void adjust_head_and_tail(char *data, qsizetype storageSize, qsizetype logicalSize)
static Q_NEVER_INLINE QBitArray & performBitwiseOperationHelper(QBitArray &out, const QBitArray &a1, const QBitArray &a2, BitwiseOp op)
static Q_NEVER_INLINE QBitArray & performBitwiseOperationInPlace(QBitArray &self, const QBitArray &other, BitwiseOp op)
QDebug operator<<(QDebug dbg, const QBitArray &array)
QBitArray operator|(const QBitArray &a1, const QBitArray &a2)
static auto prepareForBitwiseOperation(QBitArray &self, QBitArray &other)
QBitArray operator&(const QBitArray &a1, const QBitArray &a2)
static QBitArray & performBitwiseOperation(QBitArray &self, const QBitArray &other, BitwiseOp op)
static Q_NEVER_INLINE QBitArray & performBitwiseOperationInCopy(QBitArray &self, const QBitArray &other, BitwiseOp op)
static bool testBit(long bit, const long *field)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLsizei const GLfloat * v
[13]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
const void * data_ptr(const QTransform &t)
#define Q_ASSERT_X(cond, x, msg)
QtPrivate::QRegularExpressionMatchIteratorRangeBasedForIterator begin(const QRegularExpressionMatchIterator &iterator)
unsigned long long quint64
QTextStream out(stdout)
[7]
bool needsDetach() const noexcept