7#include <QtCore/qbytearray.h>
38#ifndef QT_NO_DATASTREAM
44 {
return std::move(
a).inverted_inplace(); }
49 template <
typename BitArray>
static auto bitLocation(BitArray &
ba,
qsizetype i)
53 decltype(
ba.d[1])
byte;
58 return R{
ba.d[1 + byteIdx],
uchar(1U << bitIdx) };
67#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0)
71 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(
QBitArray)
80 inline bool isEmpty()
const {
return d.isEmpty(); }
81 inline bool isNull()
const {
return d.isNull(); }
90 {
auto r = bitLocation(*
this,
i);
return r.byte &
r.bitMask; }
92 {
auto r = bitLocation(*
this,
i);
r.byte |=
r.bitMask; }
96 {
auto r = bitLocation(*
this,
i);
r.byte &=
~r.bitMask; }
99 auto r = bitLocation(*
this,
i);
100 bool cl =
r.byte &
r.bitMask;
115#if QT_CORE_REMOVED_SINCE(6, 7)
119#if QT_CORE_REMOVED_SINCE(6, 8)
125 { *
this =
QBitArray((asize < 0 ? this->
size() : asize), aval);
return true; }
130 const char *
bits()
const {
return isEmpty() ?
nullptr :
d.constData() + 1; }
143 return lhs.d == rhs.d;
148class QT6_ONLY(Q_CORE_EXPORT)
QBitRef
157 inline operator bool()
const {
return a.
testBit(
i); }
158 inline bool operator!()
const {
return !
a.testBit(
i); }
166#ifndef QT_NO_DATASTREAM
171#ifndef QT_NO_DEBUG_STREAM
void truncate(qsizetype pos)
Truncates the bit array at index position pos.
void setBit(qsizetype i, bool val)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void clear()
Clears the contents of the bit array and makes it empty.
friend QBitArray operator|(QBitArray &&a1, const QBitArray &a2)
friend QBitArray operator|(QBitArray &&a1, QBitArray &&a2)
Returns a bit array that is the OR of the bit arrays a1 and a2.
bool testBit(qsizetype i) const
Returns true if the bit at index position i is 1; otherwise returns false.
const char * bits() const
friend QBitArray operator&(QBitArray &&a1, const QBitArray &a2)
bool at(qsizetype i) const
Returns the value of the bit at index position i.
friend QBitArray operator^(QBitArray &&a1, QBitArray &&a2)
Returns a bit array that is the XOR of the bit arrays a1 and a2.
bool fill(bool aval, qsizetype asize=-1)
Sets every bit in the bit array to value, returning true if successful; otherwise returns false.
friend QBitArray operator|(const QBitArray &a1, QBitArray &&a2)
friend QBitArray operator^(QBitArray &&a1, const QBitArray &a2)
qsizetype count() const
Same as size().
void setBit(qsizetype i)
Sets the bit at index position i to 1.
bool isEmpty() const
Returns true if this bit array has size 0; otherwise returns false.
const DataPtr & data_ptr() const
friend QBitArray operator^(const QBitArray &a1, QBitArray &&a2)
friend QBitArray operator&(QBitArray &&a1, QBitArray &&a2)
Returns a bit array that is the AND of the bit arrays a1 and a2.
void clearBit(qsizetype i)
Sets the bit at index position i to 0.
friend QBitArray operator&(const QBitArray &a1, QBitArray &&a2)
bool toggleBit(qsizetype i)
Inverts the value of the bit at index position i, returning the previous value of that bit as either ...
qsizetype size() const
Returns the number of bits stored in the bit array.
bool isNull() const
Returns true if this bit array is null; otherwise returns false.
friend QBitArray operator~(QBitArray a)
Returns a bit array that contains the inverted bits of the bit array a.
bool operator[](qsizetype i) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void swap(QBitArray &other) noexcept
friend bool comparesEqual(const QBitArray &lhs, const QBitArray &rhs) noexcept
QBitRef operator[](qsizetype i)
Returns the bit at index position i as a modifiable reference.
QBitArray() noexcept
Constructs an empty bit array.
\inmodule QtCore \reentrant
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
\inmodule QtCore\reentrant
Endian
\value BigEndian Big-endian byte order (also called Network byte order) \value LittleEndian Little-en...
Combined button and popup list for selecting options.
QBitArray operator^(const QBitArray &a1, const QBitArray &a2)
#define Q_DECLARE_EQUALITY_COMPARABLE(...)
constexpr bool operator!=(const timespec &t1, const timespec &t2)
static bool testBit(long bit, const long *field)
bool comparesEqual(const QDir &lhs, const QDir &rhs)
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
constexpr QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key) noexcept
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
const void * data_ptr(const QTransform &t)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
bool operator==(const QRandomGenerator &rng1, const QRandomGenerator &rng2)
static bool operator&(QSortFilterProxyModelPrivate::Direction a, QSortFilterProxyModelPrivate::Direction b)
QUrl::FormattingOptions & operator|=(QUrl::FormattingOptions &i, QUrl::ComponentFormattingOptions f)