cxxtools::xml::EndElement Class Reference

An end element (Node) which represents a closing tag of an XML document. More...

#include <cxxtools/xml/endelement.h>

Inheritance diagram for cxxtools::xml::EndElement:
cxxtools::xml::Node

Public Member Functions

 EndElement (const String &name=String())
 Constructs a new EndElement object with the given (optional) string as tag name.
EndElementclone () const
 Clones this EndElement object by creating a duplicate on the heap and returning it.
void clear ()
Stringname ()
 Returns the tag name of the closing tag for which this EndElement object was created.
const Stringname () const
 Returns the tag name of the closing tag for which this EndElement object was created.
void setName (const String &name)
 Sets the tag name of the end tag for which this EndElement object was created.
virtual bool operator== (const Node &node) const
 Compares this EndElement object with the given node.
- Public Member Functions inherited from cxxtools::xml::Node
 Node (Type type)
 Constructs a new Node object with the specified node type.
virtual ~Node ()
 Empty destructor.
Type type () const
 Returns the type of this Node that can be used to determine what specific Node this object is.

Additional Inherited Members

- Public Types inherited from cxxtools::xml::Node
enum  Type {
  Unknown = 0, StartDocument = 1, DocType = 2, EndDocument = 3,
  StartElement = 4, EndElement = 5, Characters = 6, Comment,
  ProcessingInstruction
}

Detailed Description

An end element (Node) which represents a closing tag of an XML document.

An end element is created when the parser reaches an end tag, for example $</a>$. An EndElement object only stores the name of the tag. To access the attributes of the tag the start tag has to be read. The body of the tag can be accessed by reading the previous Character node(s).

Use name() to get the name of the tag which was closed.

When parsing $test$ a StartElement, a Character and finally an EndElement node is created. If an empty tag is parsed, like for example $$, a StartElement and an EndElement is created.

See Also
StartElement
Node

Constructor & Destructor Documentation

cxxtools::xml::EndElement::EndElement ( const String name = String())
inlineexplicit

Constructs a new EndElement object with the given (optional) string as tag name.

Parameters
nameThe name of the EndElement object. This is an optional parameter. Default is an empty string.

Member Function Documentation

void cxxtools::xml::EndElement::clear ( )
inline
EndElement* cxxtools::xml::EndElement::clone ( ) const
inlinevirtual

Clones this EndElement object by creating a duplicate on the heap and returning it.

Returns
A cloned version of this EndElement object.

Implements cxxtools::xml::Node.

String& cxxtools::xml::EndElement::name ( )
inline

Returns the tag name of the closing tag for which this EndElement object was created.

When parsing test a StartElement, a Character and finally an EndElement node is created. The EndElement has the name "a". If an empty tag is parsed, like for example , a StartElement and an EndElement ("a") is created.

Returns
The tag name of the closing tag for which this EndElement object was created.
const String& cxxtools::xml::EndElement::name ( ) const
inline

Returns the tag name of the closing tag for which this EndElement object was created.

When parsing test a StartElement, a Character and finally an EndElement node is created. The EndElement has the name "a". If an empty tag is parsed, like for example , a StartElement and an EndElement ("a") is created.

Returns
The tag name of the closing tag for which this EndElement object was created.
virtual bool cxxtools::xml::EndElement::operator== ( const Node node) const
virtual

Compares this EndElement object with the given node.

This method returns $true$ if the given node also is a EndElement object and the name of both EndElement objects is the same. Otherwise it returns $false$.

Parameters
nodeThis Node object is compared to the current EndElement node object.
Returns
$true if this EndElement object is the same as the given node.

Reimplemented from cxxtools::xml::Node.

void cxxtools::xml::EndElement::setName ( const String name)
inline

Sets the tag name of the end tag for which this EndElement object was created.

Parameters
nameThe new name for this EndElement object.

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