summaryrefslogtreecommitdiff
path: root/coreengine
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2016-07-22 15:36:25 +0200
committerlouis <louis.braun@gmx.de>2016-07-22 15:36:25 +0200
commit54c385ca1105d25cc4edf8de3490e8645f87fdca (patch)
treec33368cbc8767758a12179956c5cf1af0d2b75fb /coreengine
parenta79af20c340c77f066472d59db003f1f721c9fee (diff)
downloadvdr-plugin-skindesigner-54c385ca1105d25cc4edf8de3490e8645f87fdca.tar.gz
vdr-plugin-skindesigner-54c385ca1105d25cc4edf8de3490e8645f87fdca.tar.bz2
added noteq compare type for conditions
Diffstat (limited to 'coreengine')
-rw-r--r--coreengine/complextypes.c13
-rw-r--r--coreengine/complextypes.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/coreengine/complextypes.c b/coreengine/complextypes.c
index bcc1a50..3f8773a 100644
--- a/coreengine/complextypes.c
+++ b/coreengine/complextypes.c
@@ -177,7 +177,7 @@ bool cCondition::True(void) {
}
}
}
- else if (c->type == eCondType::lowerInt || c->type == eCondType::equalInt || c->type == eCondType::greaterInt)
+ else if (c->type == eCondType::lowerInt || c->type == eCondType::equalInt || c->type == eCondType::notequalInt || c->type == eCondType::greaterInt)
{
if (c->tokenType == eCondTokenType::inttoken) {
int tokenVal = tokenContainer->IntToken(c->tokenIndex);
@@ -185,6 +185,8 @@ bool cCondition::True(void) {
condTrue = (tokenVal < c->compareValue) ? true : false;
else if (c->type == eCondType::equalInt)
condTrue = (tokenVal == c->compareValue) ? true : false;
+ else if (c->type == eCondType::notequalInt)
+ condTrue = (tokenVal != c->compareValue) ? true : false;
else if (c->type == eCondType::greaterInt)
condTrue = (tokenVal > c->compareValue) ? true : false;
} else if (c->tokenType == eCondTokenType::stringtoken) {
@@ -195,6 +197,8 @@ bool cCondition::True(void) {
condTrue = (intVal < c->compareValue) ? true : false;
else if (c->type == eCondType::equalInt)
condTrue = (intVal == c->compareValue) ? true : false;
+ else if (c->type == eCondType::notequalInt)
+ condTrue = (intVal != c->compareValue) ? true : false;
else if (c->type == eCondType::greaterInt)
condTrue = (intVal > c->compareValue) ? true : false;
}
@@ -207,6 +211,8 @@ bool cCondition::True(void) {
condTrue = (intVal < c->compareValue) ? true : false;
else if (c->type == eCondType::equalInt)
condTrue = (intVal == c->compareValue) ? true : false;
+ else if (c->type == eCondType::notequalInt)
+ condTrue = (intVal != c->compareValue) ? true : false;
else if (c->type == eCondType::greaterInt)
condTrue = (intVal > c->compareValue) ? true : false;
}
@@ -308,6 +314,8 @@ void cCondition::Tokenize(void) {
type = eCondType::lowerInt;
} else if (startswith(cond, "eq({") && endswith(cond, ")")) {
type = eCondType::equalInt;
+ } else if (startswith(cond, "noteq({") && endswith(cond, ")")) {
+ type = eCondType::notequalInt;
} else if (startswith(cond, "gt({") && endswith(cond, ")")) {
type = eCondType::greaterInt;
} else if (startswith(cond, "isset{") && endswith(cond, "}")) {
@@ -349,6 +357,7 @@ void cCondition::PrepareTokens(void) {
break;
case eCondType::lowerInt:
case eCondType::equalInt:
+ case eCondType::notequalInt:
case eCondType::greaterInt:
SetIntegerCond(c);
break;
@@ -409,6 +418,8 @@ void cCondition::SetIntegerCond(cCond *c) {
c->isTrue = true;
else if (c->type == eCondType::equalInt && result == c->compareValue)
c->isTrue = true;
+ else if (c->type == eCondType::notequalInt && result != c->compareValue)
+ c->isTrue = true;
else if (c->type == eCondType::greaterInt && result > c->compareValue)
c->isTrue = true;
return;
diff --git a/coreengine/complextypes.h b/coreengine/complextypes.h
index 5ab6c35..1e1867a 100644
--- a/coreengine/complextypes.h
+++ b/coreengine/complextypes.h
@@ -32,6 +32,7 @@ enum class eCondType {
negtoken,
lowerInt,
equalInt,
+ notequalInt,
greaterInt,
isset,
empty,