summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2016-07-13 13:21:40 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-07-13 18:17:32 +0000
commit31b6760e64498727765b210c4285d127980aa75f (patch)
tree115710f287048077f633c2f52770d959031e6e96 /src/corelib
parent690d6be542ea513efc36fb791e128228f9e04c2d (diff)
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>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/json/qjson_p.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h
index f2fcb767d5..1cffdbc250 100644
--- a/src/corelib/json/qjson_p.h
+++ b/src/corelib/json/qjson_p.h
@@ -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>