Merge branch 'topics/condexp' into next
This commit is contained in:
@@ -41,6 +41,18 @@ private:
|
|||||||
SGConstPropertyNode_ptr _node;
|
SGConstPropertyNode_ptr _node;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Condition with constant value
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class SGConstantCondition : public SGCondition
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SGConstantCondition (bool v) : _value(v) { ; }
|
||||||
|
virtual bool test () const { return _value; }
|
||||||
|
private:
|
||||||
|
bool _value;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Condition for a 'not' operator.
|
* Condition for a 'not' operator.
|
||||||
@@ -529,6 +541,10 @@ readCondition( SGPropertyNode *prop_root, const SGPropertyNode *node )
|
|||||||
false);
|
false);
|
||||||
else if (name == "not-equals")
|
else if (name == "not-equals")
|
||||||
return readComparison(prop_root, node, SGComparisonCondition::EQUALS, true);
|
return readComparison(prop_root, node, SGComparisonCondition::EQUALS, true);
|
||||||
|
else if (name == "false")
|
||||||
|
return new SGConstantCondition(false);
|
||||||
|
else if (name == "true")
|
||||||
|
return new SGConstantCondition(true);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user