Add missing logical bitwise operators to the little-endian storage classes

These make the (future) usage in declarative even more convenient.

Change-Id: I12c0fec1ea843d8acd2ee3fdf2a2189939bebd95
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Simon Hausmann 2016-07-13 13:21:40 +02:00
parent 690d6be542
commit 31b6760e64
1 changed files with 16 additions and 0 deletions

View File

@ -151,6 +151,14 @@ public:
val = qToLittleEndian(qFromLittleEndian(val) + i);
return *this;
}
q_littleendian &operator |=(T i) {
val = qToLittleEndian(qFromLittleEndian(val) | i);
return *this;
}
q_littleendian &operator &=(T i) {
val = qToLittleEndian(qFromLittleEndian(val) & i);
return *this;
}
};
} // namespace QJsonPrivate
@ -205,6 +213,14 @@ public:
*this = (uint(*this) - i);
return *this;
}
qle_bitfield &operator |=(uint i) {
*this = (uint(*this) | i);
return *this;
}
qle_bitfield &operator &=(uint i) {
*this = (uint(*this) & i);
return *this;
}
};
template<int pos, int width>