cxxtools::xml::Characters Class Reference

A Character element (Node) of an XML document, containing the body's Text of a tag. More...

#include <cxxtools/xml/characters.h>

Inheritance diagram for cxxtools::xml::Characters:
cxxtools::xml::Node

Public Member Functions

 Characters (const String &content=String())
 Constructs a new Character object with the given (optional) string as content.
Charactersclone () const
 Clones this Character object by creating a duplicate on the heap and returning it.
bool empty () const
 Returns $true$ if the content of this Character object is empty; $false$ otherwise.
void clear ()
Stringcontent ()
 Returns the content of this Character object.
const Stringcontent () const
 Returns the content of this Character object.
void setContent (const String &content)
 Sets the content of this Character object.
virtual bool operator== (const Node &node) const
 Compares this Character 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

A Character element (Node) of an XML document, containing the body's Text of a tag.

A Character element stores the data of a tag's body. The data is interpreted before it is set as content of a Character element. This means that entities were translated into their corresponding character sequence, ...

Use content() to get the content of the CDATA element.

When parsing a tag $<a>This is the body's Text</a>$ the following content will be returned by content(): $This is the body's Text$

See Also
Node

Constructor & Destructor Documentation

cxxtools::xml::Characters::Characters ( const String content = String())
inlineexplicit

Constructs a new Character object with the given (optional) string as content.

Parameters
contentThe content of the Character object. This is an optional parameter. Default is an empty string.

Member Function Documentation

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

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

Returns
A cloned version of this Character object.

Implements cxxtools::xml::Node.

String& cxxtools::xml::Characters::content ( )
inline

Returns the content of this Character object.

The content includes the Text inside a tag's body. The Text is interpreted before it is returned, this means that for example entities are translated into their corresponding character sequence. When parsing a tag $This is the body's Text$ the followin content will be returned: $This is the body's Text$

Returns
The content of this Character object.
const String& cxxtools::xml::Characters::content ( ) const
inline

Returns the content of this Character object.

The content includes the Text inside a tag's body. The Text is interpreted before it is returned, this means that for example entities are translated into their corresponding character sequence. When parsing a tag $This is the body's Text$ the followin content will be returned: $This is the body's Text$

Returns
The content of this Character object.
bool cxxtools::xml::Characters::empty ( ) const
inline

Returns $true$ if the content of this Character object is empty; $false$ otherwise.

Returns
$true$ if the content of this Character object is empty; $false$ otherwise.
virtual bool cxxtools::xml::Characters::operator== ( const Node node) const
virtual

Compares this Character object with the given node.

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

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

Reimplemented from cxxtools::xml::Node.

void cxxtools::xml::Characters::setContent ( const String content)
inline

Sets the content of this Character object.

Parameters
contentThe new content for this Character object.

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