static bool operator==(const WQLOperand& x, const WQLOperand& y) { if( x.getType()==y.getType() ) { switch( x.getType() ) { case WQLOperand::PROPERTY_NAME: return x.getPropertyName()==y.getPropertyName(); case WQLOperand::INTEGER_VALUE: return x.getIntegerValue()==y.getIntegerValue(); case WQLOperand::DOUBLE_VALUE: return x.getDoubleValue()==y.getDoubleValue(); case WQLOperand::BOOLEAN_VALUE: return x.getBooleanValue()==y.getBooleanValue(); case WQLOperand::STRING_VALUE: return x.getStringValue()==y.getStringValue(); case WQLOperand::NULL_VALUE: return true; } } return false; }
static inline void _ResolveProperty( WQLOperand& op, const WQLPropertySource* source) { // // Resolve the operand: if it's a property name, look up its value: // if (op.getType() == WQLOperand::PROPERTY_NAME) { const CIMName& propertyName = op.getPropertyName(); if (!source->getValue(propertyName, op)) op = WQLOperand(); } }
String WQL2String(const WQLOperand &o) { switch( o.getType() ) { case WQLOperand::PROPERTY_NAME: return o.getPropertyName(); case WQLOperand::STRING_VALUE: return o.getStringValue(); case WQLOperand::INTEGER_VALUE: return Formatter::format("$0",o.getIntegerValue()); case WQLOperand::DOUBLE_VALUE: return Formatter::format("$0",o.getDoubleValue()); case WQLOperand::BOOLEAN_VALUE: return Formatter::format("$0",o.getBooleanValue()); default: ; } return "NULL_VALUE"; }