A compiled XPath query object. More...
#include <xpathquery.h>
Public Member Functions | |
XPathQuery (const Char8 *query, XPathVariableSet *variables=0) | |
Construct a compiled object from XPath expression. More... | |
~XPathQuery () | |
Destructor. | |
bool | EvaluateBoolean (const XPathNode &n) const |
Evaluate expression as boolean value in the specified context; performs Type conversion if necessary. More... | |
XPathNodeSet | EvaluateNodeSet (const XPathNode &n) const |
Evaluate expression as node set in the specified context. More... | |
double | EvaluateNumber (const XPathNode &n) const |
Evaluate expression as double value in the specified context; performs Type conversion if necessary. More... | |
String | EvaluateString (const XPathNode &n) const |
Evaluate expression as string value in the specified context; performs Type conversion if necessary. More... | |
size_t | EvaluateString (Char8 *buffer, size_t capacity, const XPathNode &n) const |
Evaluate expression as string value in the specified context; performs Type conversion if necessary. More... | |
operator unspecified_bool_type () const | |
Used to convert this to a boolean value in a safe way. More... | |
bool | operator! () const |
Logical not operator, used a workaround for borland compiler. More... | |
const XPathParseResult & | Result () const |
Get parsing Result (used to get compilation errors when XML_NO_EXCEPTIONS is enabled) More... | |
XPathValueType | ReturnType () const |
Get query expression return Type. More... | |
A compiled XPath query object.
When you call XML::Node::FindNodes with an expression string as an argument, a query object is created behind the scenes. A query object represents a compiled XPath expression. Query objects can be needed in the following circumstances:
Definition at line 91 of file xpathquery.h.
|
explicit |
Construct a compiled object from XPath expression.
query | The query in the form of a c-string style char_t array. |
variables | Any extra data the query might need, passing a null pointer simply omits passing any arguments. |
Throws | XPathException on compilation errors. |
bool Mezzanine::XML::XPathQuery::EvaluateBoolean | ( | const XPathNode & | n) | const |
Evaluate expression as boolean value in the specified context; performs Type conversion if necessary.
If | XML_NO_EXCEPTIONS is not defined (by default it is not defined), throws std::bad_alloc on out of memory errors. |
n | The XPathNode that will serve as the context for the query. |
XPathNodeSet Mezzanine::XML::XPathQuery::EvaluateNodeSet | ( | const XPathNode & | n) | const |
Evaluate expression as node set in the specified context.
n | The XPathNode that with serve as the context for the query. |
double Mezzanine::XML::XPathQuery::EvaluateNumber | ( | const XPathNode & | n) | const |
Evaluate expression as double value in the specified context; performs Type conversion if necessary.
n | The XPathNode that will serve as the context for the query. |
Throws | std::bad_alloc on out of memory errors. |
Evaluate expression as string value in the specified context; performs Type conversion if necessary.
n | The XPathNode that will serve as the context for the query. |
Throws | std::bad_alloc on out of memory errors. |
size_t Mezzanine::XML::XPathQuery::EvaluateString | ( | Char8 * | buffer, |
size_t | capacity, | ||
const XPathNode & | n | ||
) | const |
Evaluate expression as string value in the specified context; performs Type conversion if necessary.
buffer | The place to store the c-style Character array |
capacity | At most capacity characters are written to the destination buffer. |
n | The XPathNode that with serve as the context for the query. |
std::bad_alloc | on out of memory errors. |
Mezzanine::XML::XPathQuery::operator unspecified_bool_type | ( | ) | const |
Used to convert this to a boolean value in a safe way.
bool Mezzanine::XML::XPathQuery::operator! | ( | ) | const |
Logical not operator, used a workaround for borland compiler.
const XPathParseResult& Mezzanine::XML::XPathQuery::Result | ( | ) | const |
Get parsing Result (used to get compilation errors when XML_NO_EXCEPTIONS is enabled)
XPathValueType Mezzanine::XML::XPathQuery::ReturnType | ( | ) | const |
Get query expression return Type.