| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> |
| 3 * Copyright (C) 2006, 2009 Apple Inc. | 3 * Copyright (C) 2006, 2009 Apple Inc. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #ifndef XPathPath_h | 27 #ifndef XPathPath_h |
| 28 #define XPathPath_h | 28 #define XPathPath_h |
| 29 | 29 |
| 30 #include "core/xml/XPathExpressionNode.h" | 30 #include "core/xml/XPathExpressionNode.h" |
| 31 #include "core/xml/XPathNodeSet.h" | 31 #include "core/xml/XPathNodeSet.h" |
| 32 | 32 |
| 33 namespace WebCore { | 33 namespace WebCore { |
| 34 | 34 |
| 35 namespace XPath { | 35 namespace XPath { |
| 36 | 36 |
| 37 class Predicate; | 37 class Predicate; |
| 38 class Step; | 38 class Step; |
| 39 | 39 |
| 40 class Filter FINAL : public Expression { | 40 class Filter FINAL : public Expression { |
| 41 public: | 41 public: |
| 42 Filter(PassOwnPtrWillBeRawPtr<Expression>, WillBeHeapVector<OwnPtrWi
llBeMember<Predicate> >&); | 42 Filter(PassOwnPtrWillBeRawPtr<Expression>, WillBeHeapVector<OwnPtrWillBeMemb
er<Predicate> >&); |
| 43 virtual ~Filter(); | 43 virtual ~Filter(); |
| 44 virtual void trace(Visitor*) OVERRIDE; | 44 virtual void trace(Visitor*) OVERRIDE; |
| 45 | 45 |
| 46 virtual Value evaluate() const OVERRIDE; | 46 virtual Value evaluate() const OVERRIDE; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 virtual Value::Type resultType() const OVERRIDE { return Value::Node
SetValue; } | 49 virtual Value::Type resultType() const OVERRIDE { return Value::NodeSetValue
; } |
| 50 | 50 |
| 51 OwnPtrWillBeMember<Expression> m_expr; | 51 OwnPtrWillBeMember<Expression> m_expr; |
| 52 WillBeHeapVector<OwnPtrWillBeMember<Predicate> > m_predicates; | 52 WillBeHeapVector<OwnPtrWillBeMember<Predicate> > m_predicates; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class LocationPath FINAL : public Expression { | 55 class LocationPath FINAL : public Expression { |
| 56 public: | 56 public: |
| 57 LocationPath(); | 57 LocationPath(); |
| 58 virtual ~LocationPath(); | 58 virtual ~LocationPath(); |
| 59 virtual void trace(Visitor*) OVERRIDE; | 59 virtual void trace(Visitor*) OVERRIDE; |
| 60 void setAbsolute(bool value) { m_absolute = value; setIsContextNodeS
ensitive(!m_absolute); } | |
| 61 | 60 |
| 62 virtual Value evaluate() const OVERRIDE; | 61 virtual Value evaluate() const OVERRIDE; |
| 63 void evaluate(NodeSet& nodes) const; // nodes is an input/output par
ameter | 62 void setAbsolute(bool value) { m_absolute = value; setIsContextNodeSensitive
(!m_absolute); } |
| 63 void evaluate(NodeSet&) const; // nodes is an input/output parameter |
| 64 void appendStep(Step*); |
| 65 void insertFirstStep(Step*); |
| 64 | 66 |
| 65 void appendStep(Step* step); | 67 private: |
| 66 void insertFirstStep(Step* step); | 68 virtual Value::Type resultType() const OVERRIDE { return Value::NodeSetValue
; } |
| 67 | 69 |
| 68 private: | 70 WillBeHeapVector<RawPtrWillBeMember<Step> > m_steps; |
| 69 virtual Value::Type resultType() const OVERRIDE { return Value::Node
SetValue; } | 71 bool m_absolute; |
| 72 }; |
| 70 | 73 |
| 71 WillBeHeapVector<RawPtrWillBeMember<Step> > m_steps; | 74 class Path FINAL : public Expression { |
| 72 bool m_absolute; | 75 public: |
| 73 }; | 76 Path(Expression*, LocationPath*); |
| 77 virtual ~Path(); |
| 78 virtual void trace(Visitor*) OVERRIDE; |
| 74 | 79 |
| 75 class Path FINAL : public Expression { | 80 virtual Value evaluate() const OVERRIDE; |
| 76 public: | |
| 77 Path(Expression*, LocationPath*); | |
| 78 virtual ~Path(); | |
| 79 virtual void trace(Visitor*) OVERRIDE; | |
| 80 | 81 |
| 81 virtual Value evaluate() const OVERRIDE; | 82 private: |
| 83 virtual Value::Type resultType() const OVERRIDE { return Value::NodeSetValue
; } |
| 82 | 84 |
| 83 private: | 85 OwnPtrWillBeMember<Expression> m_filter; |
| 84 virtual Value::Type resultType() const OVERRIDE { return Value::Node
SetValue; } | 86 OwnPtrWillBeMember<LocationPath> m_path; |
| 87 }; |
| 85 | 88 |
| 86 OwnPtrWillBeMember<Expression> m_filter; | |
| 87 OwnPtrWillBeMember<LocationPath> m_path; | |
| 88 }; | |
| 89 | |
| 90 } | |
| 91 } | 89 } |
| 92 | 90 |
| 93 #endif // XPath_Path_H | 91 } |
| 92 #endif // XPathPath_h |
| OLD | NEW |