QtCore/qbitarray.h Source File
Go to the documentation of this file.
58 friend Q_CORE_EXPORT uint
qHash(
const QBitArray &key);
63 explicit QBitArray(
int size,
bool val =
false);
65 inline QBitArray &
operator=(
const QBitArray &other) { d = other.d;
return *
this; }
66 #ifdef Q_COMPILER_RVALUE_REFS
67 inline QBitArray &operator=(QBitArray &&other)
68 {
qSwap(d, other.d);
return *
this; }
71 inline void swap(QBitArray &other) {
qSwap(d, other.d); }
75 int count(
bool on)
const;
81 void resize(
int size);
87 bool testBit(
int i)
const;
89 void setBit(
int i,
bool val);
91 bool toggleBit(
int i);
94 QBitRef operator[](
int i);
95 bool operator[](
int i)
const;
96 QBitRef operator[](uint i);
97 bool operator[](uint i)
const;
99 QBitArray& operator&=(
const QBitArray &);
100 QBitArray& operator|=(
const QBitArray &);
101 QBitArray& operator^=(
const QBitArray &);
102 QBitArray operator~()
const;
104 inline bool operator==(
const QBitArray&
a)
const {
return d == a.d; }
105 inline bool operator!=(
const QBitArray&
a)
const {
return d != a.d; }
107 inline bool fill(
bool val,
int size = -1);
108 void fill(
bool val,
int first,
int last);
118 { *
this =
QBitArray((asize < 0 ? this->
size() : asize), aval);
return true; }
125 { Q_ASSERT(uint(i) < uint(
size()));
126 return (*(reinterpret_cast<const uchar*>(d.
constData())+1+(i>>3)) & (1 << (i & 7))) != 0; }
129 { Q_ASSERT(uint(i) < uint(
size()));
130 *(
reinterpret_cast<uchar*
>(d.
data())+1+(i>>3)) |= uchar(1 << (i & 7)); }
133 { Q_ASSERT(uint(i) < uint(
size()));
134 *(
reinterpret_cast<uchar*
>(d.
data())+1+(i>>3)) &= ~uchar(1 << (i & 7)); }
140 { Q_ASSERT(uint(i) < uint(
size()));
141 uchar
b = uchar(1<<(i&7)); uchar*
p =
reinterpret_cast<uchar*
>(d.
data())+1+(i>>3);
142 uchar
c = uchar(*p&b); *p^=
b;
return c!=0; }
156 inline operator bool()
const {
return a.
testBit(i); }
163 { Q_ASSERT(i >= 0);
return QBitRef(*
this, i); }
168 #ifndef QT_NO_DATASTREAM
180 #endif // QBITARRAY_H
uint PHONON_EXPORT qHash(const Phonon::EffectParameter ¶m)
QByteArray::DataPtr DataPtr
QBitArray(const QBitArray &other)
Q_DECLARE_TYPEINFO(QBitArray, Q_MOVABLE_TYPE)
QBitArray & operator=(const QBitArray &other)
const char * constData() const
Q_CORE_EXPORT QBitArray operator^(const QBitArray &, const QBitArray &)
Q_CORE_EXPORT QBitArray operator&(const QBitArray &, const QBitArray &)
#define QT_BEGIN_NAMESPACE
bool operator==(const QBitArray &a) const
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
bool operator!=(const QBitArray &a) const
QBitRef & operator=(bool val)
GLuint GLuint GLsizei count
Q_CORE_EXPORT QDataStream & operator<<(QDataStream &, const QBitArray &)
Q_CORE_EXPORT QDataStream & operator>>(QDataStream &, QBitArray &)
bool fill(bool val, int size=-1)
QBitRef operator[](int i)
GLubyte GLubyte GLubyte a
void swap(QBitArray &other)
bool testBit(int i) const
Q_CORE_EXPORT QBitArray operator|(const QBitArray &, const QBitArray &)
QBitRef & operator=(const QBitRef &val)