diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebCore/xml/XPathPath.h | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebCore/xml/XPathPath.h')
-rw-r--r-- | Source/WebCore/xml/XPathPath.h | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/Source/WebCore/xml/XPathPath.h b/Source/WebCore/xml/XPathPath.h index b1a57cbb7..5491618a8 100644 --- a/Source/WebCore/xml/XPathPath.h +++ b/Source/WebCore/xml/XPathPath.h @@ -1,6 +1,6 @@ /* * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> - * Copyright (C) 2006, 2009 Apple Inc. + * Copyright (C) 2006, 2009, 2013 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,60 +28,54 @@ #define XPathPath_h #include "XPathExpressionNode.h" -#include "XPathNodeSet.h" namespace WebCore { namespace XPath { - class Predicate; class Step; - class Filter : public Expression { + class Filter final : public Expression { public: - Filter(Expression*, const Vector<Predicate*>& = Vector<Predicate*>()); - virtual ~Filter(); - - virtual Value evaluate() const; + Filter(std::unique_ptr<Expression>, Vector<std::unique_ptr<Expression>> predicates); private: - virtual Value::Type resultType() const { return Value::NodeSetValue; } + virtual Value evaluate() const override; + virtual Value::Type resultType() const override { return Value::NodeSetValue; } - Expression* m_expr; - Vector<Predicate*> m_predicates; + std::unique_ptr<Expression> m_expression; + Vector<std::unique_ptr<Expression>> m_predicates; }; - class LocationPath : public Expression { + class LocationPath final : public Expression { public: LocationPath(); - virtual ~LocationPath(); - void setAbsolute(bool value) { m_absolute = value; setIsContextNodeSensitive(!m_absolute); } - virtual Value evaluate() const; + void setAbsolute() { m_isAbsolute = true; setIsContextNodeSensitive(false); } + void evaluate(NodeSet& nodes) const; // nodes is an input/output parameter - void appendStep(Step* step); - void insertFirstStep(Step* step); + void appendStep(std::unique_ptr<Step>); + void prependStep(std::unique_ptr<Step>); private: - virtual Value::Type resultType() const { return Value::NodeSetValue; } + virtual Value evaluate() const override; + virtual Value::Type resultType() const override { return Value::NodeSetValue; } - Vector<Step*> m_steps; - bool m_absolute; + Vector<std::unique_ptr<Step>> m_steps; + bool m_isAbsolute; }; - class Path : public Expression { + class Path final : public Expression { public: - Path(Filter*, LocationPath*); - virtual ~Path(); - - virtual Value evaluate() const; + Path(std::unique_ptr<Expression> filter, std::unique_ptr<LocationPath>); private: - virtual Value::Type resultType() const { return Value::NodeSetValue; } + virtual Value evaluate() const override; + virtual Value::Type resultType() const override { return Value::NodeSetValue; } - Filter* m_filter; - LocationPath* m_path; + std::unique_ptr<Expression> m_filter; + std::unique_ptr<LocationPath> m_path; }; } |