0
0
mirror of https://github.com/zeux/pugixml.git synced 2025-01-17 04:50:23 +08:00

XPath: Context node for evaluate is now an xpath_node (can use attribute contexts)

git-svn-id: http://pugixml.googlecode.com/svn/trunk@663 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2010-08-29 15:27:29 +00:00
parent 7fab1bf757
commit 7554e20688
2 changed files with 10 additions and 10 deletions

View File

@ -1999,7 +1999,7 @@ namespace pugi
* \param n - context node * \param n - context node
* \return evaluation result * \return evaluation result
*/ */
bool evaluate_boolean(const xml_node& n) const; bool evaluate_boolean(const xpath_node& n) const;
/** /**
* Evaluate expression as double value for the context node \a n. * Evaluate expression as double value for the context node \a n.
@ -2010,7 +2010,7 @@ namespace pugi
* \param n - context node * \param n - context node
* \return evaluation result * \return evaluation result
*/ */
double evaluate_number(const xml_node& n) const; double evaluate_number(const xpath_node& n) const;
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
/** /**
@ -2022,7 +2022,7 @@ namespace pugi
* \param n - context node * \param n - context node
* \return evaluation result * \return evaluation result
*/ */
string_t evaluate_string(const xml_node& n) const; string_t evaluate_string(const xpath_node& n) const;
#endif #endif
/** /**
@ -2034,7 +2034,7 @@ namespace pugi
* \param n - context node * \param n - context node
* \return evaluation result * \return evaluation result
*/ */
size_t evaluate_string(char_t* buffer, size_t capacity, const xml_node& n) const; size_t evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const;
/** /**
* Evaluate expression as node set for the context node \a n. * Evaluate expression as node set for the context node \a n.
@ -2044,7 +2044,7 @@ namespace pugi
* \param n - context node * \param n - context node
* \return evaluation result * \return evaluation result
*/ */
xpath_node_set evaluate_node_set(const xml_node& n) const; xpath_node_set evaluate_node_set(const xpath_node& n) const;
// Get parsing result // Get parsing result
const xpath_parse_result& result() const; const xpath_parse_result& result() const;

View File

@ -3748,7 +3748,7 @@ namespace pugi
return _root->rettype(); return _root->rettype();
} }
bool xpath_query::evaluate_boolean(const xml_node& n) const bool xpath_query::evaluate_boolean(const xpath_node& n) const
{ {
if (!_root) return false; if (!_root) return false;
@ -3757,7 +3757,7 @@ namespace pugi
return _root->eval_boolean(c); return _root->eval_boolean(c);
} }
double xpath_query::evaluate_number(const xml_node& n) const double xpath_query::evaluate_number(const xpath_node& n) const
{ {
if (!_root) return gen_nan(); if (!_root) return gen_nan();
@ -3767,7 +3767,7 @@ namespace pugi
} }
#ifndef PUGIXML_NO_STL #ifndef PUGIXML_NO_STL
string_t xpath_query::evaluate_string(const xml_node& n) const string_t xpath_query::evaluate_string(const xpath_node& n) const
{ {
if (!_root) return string_t(); if (!_root) return string_t();
@ -3777,7 +3777,7 @@ namespace pugi
} }
#endif #endif
size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xml_node& n) const size_t xpath_query::evaluate_string(char_t* buffer, size_t capacity, const xpath_node& n) const
{ {
xpath_context c(n, 1, 1); xpath_context c(n, 1, 1);
xpath_string r = _root ? _root->eval_string(c) : xpath_string(); xpath_string r = _root ? _root->eval_string(c) : xpath_string();
@ -3790,7 +3790,7 @@ namespace pugi
return size; return size;
} }
xpath_node_set xpath_query::evaluate_node_set(const xml_node& n) const xpath_node_set xpath_query::evaluate_node_set(const xpath_node& n) const
{ {
if (!_root) return xpath_node_set(); if (!_root) return xpath_node_set();