00001 #ifndef _xpathoppredicate_h 00002 #define _xpathoppredicate_h 00003 00004 #include <spl/Debug.h> 00005 #include <spl/RefCountPtrCast.h> 00006 #include <spl/Variant.h> 00007 #include <spl/xml/xpath/private/XPathOperator.h> 00008 00009 class XPathOpPredicate; 00010 typedef RefCountPtrCast<XPathOpPredicate, XPathOperator, XPathOperatorPtr> XPathOpPredicatePtr; 00011 00014 class XPathOpPredicate : public XPathOperator 00015 { 00016 public: 00017 typedef enum _Operator 00018 { 00019 OP_ERROR = 0, 00020 OP_EQ = 19, 00021 OP_NEQ = 20, 00022 OP_LT = 21, 00023 OP_LTEQ = 22, 00024 OP_GT = 23, 00025 OP_GTEQ = 24, 00026 } Operator; 00027 00028 private: 00029 Vector<XPathOperatorPtr> m_ops; 00030 Operator m_binop; 00031 VariantPtr m_arg; 00032 00033 public: 00034 XPathOpPredicate(); 00035 XPathOpPredicate(const XPathOpPredicate& op); 00036 virtual ~XPathOpPredicate(); 00037 00038 XPathOpPredicate& operator =(const XPathOpPredicate& oproot); 00039 00040 virtual bool IsMatch(XmlNode& context); 00041 virtual XmlNodeListPtr NextContext(XmlNodePtr context); 00042 00043 inline Vector<XPathOperatorPtr>& Operators() { return m_ops; } 00044 inline Operator& BinOp() { return m_binop; } 00045 inline VariantPtr Arg() { return m_arg; } 00046 00047 #if defined(DEBUG) || defined(_DEBUG) 00048 void CheckMem() const; 00049 void ValidateMem() const; 00050 #endif 00051 }; 00052 00053 #endif