aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/booleancondition.cpp
blob: c0b429989457c139b3ff241b8ad27a37cef51873 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
}