I have added &= and |= for the Solid::Predicate C++ classes.
Ok to commit?
Chris
Index: solid/solid/predicate.cpp
===================================================================
--- solid/solid/predicate.cpp	(revision 776426)
+++ solid/solid/predicate.cpp	(working copy)
@@ -153,6 +153,12 @@
     return result;
 }
 
+Solid::Predicate &Solid::Predicate::operator &=(const Predicate &other)
+{
+    *this = *this & other;
+    return *this;
+}
+
 Solid::Predicate Solid::Predicate::operator|(const Predicate &other)
 {
     Predicate result;
@@ -165,6 +171,12 @@
     return result;
 }
 
+Solid::Predicate &Solid::Predicate::operator |=(const Predicate &other)
+{
+    *this = *this | other;
+    return *this;
+}
+
 bool Solid::Predicate::isValid() const
 {
     return d->isValid;
Index: solid/solid/predicate.h
===================================================================
--- solid/solid/predicate.h	(revision 776426)
+++ solid/solid/predicate.h	(working copy)
@@ -128,6 +128,14 @@
         Predicate operator &(const Predicate &other);
 
         /**
+         * 'AndEquals' operator.
+         *
+         * @param other the second operand
+         * @return assigns to 'this' a new 'and' predicate having 'this' and 'other' as operands
+         */
+        Predicate &operator &=(const Predicate &other);
+
+        /**
          * 'Or' operator.
          *
          * @param other the second operand
@@ -135,6 +143,13 @@
          */
         Predicate operator|(const Predicate &other);
 
+        /**
+         * 'OrEquals' operator.
+         *
+         * @param other the second operand
+         * @return assigns to 'this' a new 'or' predicate having 'this' and 'other' as operands
+         */
+        Predicate &operator|=(const Predicate &other);
 
         /**
          * Indicates if the predicate is valid.
_______________________________________________
Kde-hardware-devel mailing list
Kde-hardware-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-hardware-devel

Reply via email to