pugi::xpath_node Class Reference

Collaboration diagram for pugi::xpath_node:

Collaboration graph
[legend]
List of all members.

Detailed Description

XPath node class.

XPath defines node to be either xml_node or xml_attribute in pugixml terminology, so xpath_node is either xml_node or xml_attribute.


Public Member Functions

 xpath_node ()
 Construct empty XPath node.
 xpath_node (const xml_node &node)
 Construct XPath node from XML node.
 xpath_node (const xml_attribute &attribute, const xml_node &parent)
 Construct XPath node from XML attribute.
xml_node node () const
 Get XML node, if any.
xml_attribute attribute () const
 Get XML attribute, if any.
xml_node parent () const
 Get parent of contained XML attribute, if any.
 operator unspecified_bool_type () const
 Safe bool conversion.
bool operator! () const
bool operator== (const xpath_node &n) const
 Compares two XPath nodes.
bool operator!= (const xpath_node &n) const
 Compares two XPath nodes.


Constructor & Destructor Documentation

pugi::xpath_node::xpath_node const xml_node node  ) 
 

Construct XPath node from XML node.

Parameters:
node - XML node

pugi::xpath_node::xpath_node const xml_attribute attribute,
const xml_node parent
 

Construct XPath node from XML attribute.

Parameters:
attribute - XML attribute
parent - attribute's parent node


Member Function Documentation

xml_node pugi::xpath_node::node  )  const
 

Get XML node, if any.

Returns:
contained XML node, empty node otherwise

xml_attribute pugi::xpath_node::attribute  )  const
 

Get XML attribute, if any.

Returns:
contained XML attribute, if any, empty attribute otherwise

xml_node pugi::xpath_node::parent  )  const
 

Get parent of contained XML attribute, if any.

Returns:
parent of contained XML attribute, if any, empty node otherwise

pugi::xpath_node::operator unspecified_bool_type  )  const
 

Safe bool conversion.

Allows xpath_node to be used in a context where boolean variable is expected, such as 'if (node)'.

bool pugi::xpath_node::operator== const xpath_node n  )  const
 

Compares two XPath nodes.

Parameters:
n - XPath node to compare to
Returns:
comparison result

bool pugi::xpath_node::operator!= const xpath_node n  )  const
 

Compares two XPath nodes.

Parameters:
n - XPath node to compare to
Returns:
comparison result


Generated on Tue May 25 23:22:42 2010 for pugixml by  doxygen 1.4.6-NO