summaryrefslogtreecommitdiffstats
path: root/src/condparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/condparser.cpp')
-rw-r--r--src/condparser.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/condparser.cpp b/src/condparser.cpp
index e76b164..ac6ff61 100644
--- a/src/condparser.cpp
+++ b/src/condparser.cpp
@@ -2,8 +2,8 @@
* Copyright (C) 1997-2015 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
+ * documentation under the terms of the GNU General Public License is hereby
+ * granted. No representations are made about the suitability of this software
* for any purpose. It is provided "as is" without express or implied warranty.
* See the GNU General Public License for more details.
*
@@ -19,6 +19,8 @@
* ! NOT operator
*/
+#include <algorithm>
+
#include "condparser.h"
#include "config.h"
#include "message.h"
@@ -27,7 +29,7 @@
/**
* parses and evaluates the given expression.
- * @returns
+ * @returns
* - On error, an error message is returned.
* - On success, the result of the expression is either "1" or "0".
*/
@@ -123,13 +125,13 @@ int CondParser::getOperatorId(const QCString &opName)
/**
* Get next token in the current string expr.
- * Uses the data in m_expr pointed to by m_e to
+ * Uses the data in m_expr pointed to by m_e to
* produce m_tokenType and m_token, set m_err in case of an error
*/
void CondParser::getToken()
{
m_tokenType = NOTHING;
- m_token.resize(0);
+ m_token.resize(0);
//printf("\tgetToken e:{%c}, ascii=%i, col=%i\n", *e, *e, e-expr);
@@ -303,7 +305,7 @@ bool CondParser::evalOperator(int opId, bool lhs, bool rhs)
*/
bool CondParser::evalVariable(const char *varName)
{
- if (Config_getList(ENABLED_SECTIONS).find(varName)==-1) return FALSE;
- return TRUE;
+ const StringVector &list = Config_getList(ENABLED_SECTIONS);
+ return std::find(list.begin(),list.end(),varName)!=list.end();
}