Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

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 Characters:

Node

List of all members.

Public Member Functions

 Characters (const String &content=String())
 Constructs a new Character object with the given (optional) string as content.
 ~Characters ()
 Empty destructor.
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.


Detailed Description

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

Characters ( const String content = String()  ) 

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


Member Function Documentation

Characters* clone (  )  const [virtual]

Returns:
A cloned version of this Character object.

Implements Node.

bool empty (  )  const

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

String& content (  ) 

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& content (  )  const

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.

void setContent ( const String content  ) 

Parameters:
content The new content for this Character object.

virtual bool operator== ( const Node node  )  const [virtual]

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:
node This 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 Node.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6