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 19 matching lines...) Expand all Loading... |
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 : public Expression { | 40 class Filter FINAL : public Expression { |
41 public: | 41 public: |
42 Filter(PassOwnPtr<Expression>, Vector<OwnPtr<Predicate> >&); | 42 Filter(PassOwnPtr<Expression>, Vector<OwnPtr<Predicate> >&); |
43 virtual ~Filter(); | 43 virtual ~Filter(); |
44 | 44 |
45 virtual Value evaluate() const; | 45 virtual Value evaluate() const OVERRIDE; |
46 | 46 |
47 private: | 47 private: |
48 virtual Value::Type resultType() const { return Value::NodeSetValue;
} | 48 virtual Value::Type resultType() const OVERRIDE { return Value::Node
SetValue; } |
49 | 49 |
50 OwnPtr<Expression> m_expr; | 50 OwnPtr<Expression> m_expr; |
51 Vector<OwnPtr<Predicate> > m_predicates; | 51 Vector<OwnPtr<Predicate> > m_predicates; |
52 }; | 52 }; |
53 | 53 |
54 class LocationPath : public Expression { | 54 class LocationPath FINAL : public Expression { |
55 public: | 55 public: |
56 LocationPath(); | 56 LocationPath(); |
57 virtual ~LocationPath(); | 57 virtual ~LocationPath(); |
58 void setAbsolute(bool value) { m_absolute = value; setIsContextNodeS
ensitive(!m_absolute); } | 58 void setAbsolute(bool value) { m_absolute = value; setIsContextNodeS
ensitive(!m_absolute); } |
59 | 59 |
60 virtual Value evaluate() const; | 60 virtual Value evaluate() const OVERRIDE; |
61 void evaluate(NodeSet& nodes) const; // nodes is an input/output par
ameter | 61 void evaluate(NodeSet& nodes) const; // nodes is an input/output par
ameter |
62 | 62 |
63 void appendStep(Step* step); | 63 void appendStep(Step* step); |
64 void insertFirstStep(Step* step); | 64 void insertFirstStep(Step* step); |
65 | 65 |
66 private: | 66 private: |
67 virtual Value::Type resultType() const { return Value::NodeSetValue;
} | 67 virtual Value::Type resultType() const OVERRIDE { return Value::Node
SetValue; } |
68 | 68 |
69 Vector<Step*> m_steps; | 69 Vector<Step*> m_steps; |
70 bool m_absolute; | 70 bool m_absolute; |
71 }; | 71 }; |
72 | 72 |
73 class Path : public Expression { | 73 class Path FINAL : public Expression { |
74 public: | 74 public: |
75 Path(Filter*, LocationPath*); | 75 Path(Expression*, LocationPath*); |
76 virtual ~Path(); | 76 virtual ~Path(); |
77 | 77 |
78 virtual Value evaluate() const; | 78 virtual Value evaluate() const OVERRIDE; |
79 | 79 |
80 private: | 80 private: |
81 virtual Value::Type resultType() const { return Value::NodeSetValue;
} | 81 virtual Value::Type resultType() const OVERRIDE { return Value::Node
SetValue; } |
82 | 82 |
83 Filter* m_filter; | 83 Expression* m_filter; |
84 LocationPath* m_path; | 84 LocationPath* m_path; |
85 }; | 85 }; |
86 | 86 |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 #endif // XPath_Path_H | 90 #endif // XPath_Path_H |
OLD | NEW |