]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/SGExpression.cxx
Initial work on CMake support for SimGear.
[simgear.git] / simgear / structure / SGExpression.cxx
index dc0d3270baeacded83a09186f0447e8856050b06..78d6daf0f7355072900695826dbc8f9fb7d75313 100644 (file)
@@ -33,6 +33,7 @@
 #include <string>
 #include <sstream>
 #include <boost/bind.hpp>
+#include <cstring> // for strcmp
 
 #include <simgear/props/props.hxx>
 
@@ -292,6 +293,21 @@ SGReadIExpression(SGPropertyNode *inputRoot, const SGPropertyNode *expression)
         }
         return output;
     }
+
+    if (name == "difference" || name == "dif" ) {
+        if (expression->nChildren() < 1) {
+            SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
+            return 0;
+        }
+        SGDifferenceExpression<T>* output = new SGDifferenceExpression<T>;
+        if (!SGReadNaryOperands(output, inputRoot, expression)) {
+            delete output;
+            SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");
+            return 0;
+        }
+        return output;
+    }
+
     if (name == "prod" || name == "product") {
         if (expression->nChildren() < 1) {
             SG_LOG(SG_IO, SG_ALERT, "Cannot read \"" << name << "\" expression.");