This commit is contained in:
jez 2007-12-20 16:23:56 +00:00
parent cdac22542e
commit f87c01fc53
3 changed files with 32 additions and 3 deletions

View file

@ -14,14 +14,13 @@ template<class string_type, class string_adaptor = Arabica::default_string_adapt
class MatchExpr
{
public:
MatchExpr(XPathExpression_impl<string_type, string_adaptor>* match, double priority) :
match_(match), priority_(priority) { }
MatchExpr(XPathExpression_impl<string_type, string_adaptor>* match, double priority);
MatchExpr(const MatchExpr& rhs) :
match_(rhs.match_), priority_(rhs.priority_) { }
MatchExpr& operator=(const MatchExpr& rhs)
{ match_ = rhs.match_; priority_ = rhs.priority_; return *this; }
double priority() const { return priority_; }
double priority() const { return priority_; }
bool evaluate(const DOM::Node<string_type, string_adaptor>& context,
const ExecutionContext<string_type, string_adaptor>& executionContext) const
{
@ -33,6 +32,9 @@ public:
private:
XPathExpression<string_type, string_adaptor> match_;
double priority_;
MatchExpr();
bool operator==(const MatchExpr&) const;
}; // MatchExpr
namespace impl
@ -80,6 +82,11 @@ public:
private:
std::vector<MatchExpr<string_type, string_adaptor> > matches_;
MatchExpressionWrapper();
MatchExpressionWrapper(const MatchExpressionWrapper&);
MatchExpressionWrapper& operator=(const MatchExpressionWrapper&);
bool operator==(const MatchExpressionWrapper&) const;
}; // class MatchExpressionWrapper
} // namespace impl

View file

@ -0,0 +1,21 @@
#ifndef ARABICA_XPATHIC_MATCH_REWRITE_HPP
#define ARABICA_XPATHIC_MATCH_REWRITE_HPP
namespace Arabica
{
namespace XPath
{
template<class string_type, class string_adaptor>
MatchExpr<string_type, string_adaptor>::MatchExpr(XPathExpression_impl<string_type, string_adaptor>* match, double priority) :
match_(match), priority_(priority)
{
impl::StepExpression<string_type, string_adaptor>* step = static_cast<impl::StepExpression<string_type, string_adaptor>*>(match);
// loop through predicates here
} // MatchExpr
} // namespace XPath
} // namespace Arabica
#endif

View file

@ -505,6 +505,7 @@ private:
#include "xpath_relational.hpp"
#include "xpath_logical.hpp"
#include "xpath_step.hpp"
#include "xpath_match_rewrite.hpp"
#include "xpath_compile_context.hpp"
#include "xpath_variable.hpp"
#include "xpath_function_holder.hpp"