aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/booleancondition.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'booleancondition.cpp')
-rw-r--r--booleancondition.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/booleancondition.cpp b/booleancondition.cpp
new file mode 100644
index 0000000..c0b4299
--- /dev/null
+++ b/booleancondition.cpp
@@ -0,0 +1,35 @@
+#include "booleancondition.h"
+
+
+BooleanCondition::BooleanCondition()
+{
+}
+bool BooleanCondition::isValid(qint64 b) const
+{
+ switch(m_operator)
+ {
+ case Equal:
+ return (b==m_value);
+ case GreaterThan:
+ return (b>m_value);
+ case LesserThan:
+ return (b<m_value);
+ case GreaterOrEqual:
+ return (b>=m_value);
+ case LesserOrEqual:
+ return (b<=m_value);
+
+
+ }
+ return false;
+}
+
+void BooleanCondition::setOperator(LogicOperator m)
+{
+ m_operator = m;
+}
+
+void BooleanCondition::setValue(qint64 v)
+{
+ m_value=v;
+}