![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Minimal SQL-flavoured expression evaluator for the RuleBasedRenderer. Slice X.25. More...
#include <QString>#include <QVariantMap>Go to the source code of this file.
Classes | |
| class | OpenSWMM::Render::ExpressionEvaluator |
Namespaces | |
| namespace | OpenSWMM |
| namespace | OpenSWMM::Render |
Minimal SQL-flavoured expression evaluator for the RuleBasedRenderer. Slice X.25.
Goal: cover the QGIS / SQL-WHERE common cases so styles authored externally evaluate correctly, without rebuilding a full expression language.
Grammar (informal): expr ::= or or ::= and ( "OR" and )* and ::= not ( "AND" not )* not ::= "NOT" not | comparison comp ::= primary [ ("=" | "!=" | "<>" | "<" | "<=" | ">" | ">=") primary | "IS" ["NOT"] "NULL" | "LIKE" string ] primary ::= number | string | identifier | "(" expr ")"
Strings: single-quoted, with "''" as embedded quote. Numbers: integer or decimal, no exponent. Identifiers: bare attribute names — read out of the QVariantMap by the same key.
The eval function returns true on match, false otherwise; malformed expressions return false and a non-empty error string in lastError().