MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
Mezzanine::XML::XPathNode Class Reference

An XPath node which can store handles to a XML::Node or an XML::Attribute. More...

#include <xpathnode.h>

Public Member Functions

 XPathNode ()
 Default constructor; constructs empty XPath node.
 
 XPathNode (const Node &node)
 Construct From a XML::Node. More...
 
 XPathNode (const Attribute &GetAttribute, const Node &GetParent)
 Construct From a XML::Attribute. More...
 
Attribute GetAttribute () const
 Get the XML::Attribute this is referencing. More...
 
Node GetNode () const
 Get the XML::Node this is referencing. More...
 
Node GetParent () const
 Get the parent of the XML::Node or XML::Attribute this refers to. 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...
 
bool operator!= (const XPathNode &n) const
 Called when comparing two XPathNode instances for inequality. More...
 
bool operator== (const XPathNode &n) const
 Called when comparing two XPathNode instances for equality. More...
 

Detailed Description

An XPath node which can store handles to a XML::Node or an XML::Attribute.

Because an XPath node can be either a XML::Node or an XML::Attribute, there is a special type, XPathNode, which is a discriminated union of these types. A value of this type contains two node handles, one of XML::Node type, and another one of XML::Attribute type; at most one of them can be non-null. The accessors to get these handles are available: XPathNode::GetNode() an XPathNode::GetAttribute() .

XPath nodes can be null, in which case both accessors return null handles.

Definition at line 76 of file xpathnode.h.

Constructor & Destructor Documentation

Mezzanine::XML::XPathNode::XPathNode ( const Node node)

Construct From a XML::Node.

Parameters
nodeThe XML::Node this handle should reference.
Mezzanine::XML::XPathNode::XPathNode ( const Attribute GetAttribute,
const Node GetParent 
)

Construct From a XML::Attribute.

Parameters
GetAttributeThe XML::Attribute this handle should reference.
GetParentThe XML::Node the XML::Attribute is on.

Member Function Documentation

Attribute Mezzanine::XML::XPathNode::GetAttribute ( ) const

Get the XML::Attribute this is referencing.

Returns
A valid XML::Attribute, or a null node if this doesn't reference a an XML::Attribute.
Node Mezzanine::XML::XPathNode::GetNode ( ) const

Get the XML::Node this is referencing.

Returns
A valid XML::Node, or a null node if this doesn't reference a an XML::Node.
Node Mezzanine::XML::XPathNode::GetParent ( ) const

Get the parent of the XML::Node or XML::Attribute this refers to.

Returns
A valid XML::Node, or a null node if this doesn't reference a an XML::Node.
Mezzanine::XML::XPathNode::operator unspecified_bool_type ( ) const

Used to convert this to a boolean value in a safe way.

Returns
Returns true if the internal data is set and false otherwise.
Note
Not available in scripting languages.
bool Mezzanine::XML::XPathNode::operator! ( ) const

Logical not operator, used a workaround for borland compiler.

Returns
A bool that is the opposite of evaluatig this as a bool normally.
bool Mezzanine::XML::XPathNode::operator!= ( const XPathNode n) const

Called when comparing two XPathNode instances for inequality.

Parameters
nThe other XML::XPathNode to compare this Node against for inequality.
Returns
True if this and the other XML::XPathNode are referencing the same item, false otherwise;
bool Mezzanine::XML::XPathNode::operator== ( const XPathNode n) const

Called when comparing two XPathNode instances for equality.

Parameters
nThe other XML::XPathNode to compare this Node against for equality.
Returns
True if this and the other XML::XPathNode are referencing the same item, false otherwise;

The documentation for this class was generated from the following file: