From b56f09d2d9bd979cdf6e0a67ea63f69d474f2add Mon Sep 17 00:00:00 2001 From: jez Date: Mon, 13 Jul 2009 09:24:03 +0100 Subject: [PATCH] added NodeSetXPathFunction base class --- include/XPath/impl/xpath_function.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/XPath/impl/xpath_function.hpp b/include/XPath/impl/xpath_function.hpp index f15b0877..1c890793 100644 --- a/include/XPath/impl/xpath_function.hpp +++ b/include/XPath/impl/xpath_function.hpp @@ -136,6 +136,26 @@ protected: const ExecutionContext& executionContext) const = 0; }; // class StringXPathFunction +template > +class NodeSetXPathFunction : public XPathFunction +{ +public: + NodeSetXPathFunction(int minArgs, int maxArgs, const std::vector >& args) : + XPathFunction(minArgs, maxArgs, args) { } + + virtual ValueType type() const { return NODE_SET; } + + virtual XPathValue_impl* evaluate(const DOM::Node& context, + const ExecutionContext& executionContext) const + { + return new NodeSetValue(doEvaluate(context, executionContext)); + } // evaluate + +protected: + virtual NodeSet doEvaluate(const DOM::Node& context, + const ExecutionContext& executionContext) const = 0; +}; // class NodeSetXPathFunction + namespace impl {