cxxtools::xml::Comment Class Reference

A Comment element (Node) of an XML document, containing the comment's content. More...

#include <cxxtools/xml/comment.h>

Inheritance diagram for cxxtools::xml::Comment:
cxxtools::xml::Node

Public Member Functions

 Comment (const String &text)
 Constructs a new Comment object with the given string as content/Text.
Commentclone () const
 Clones this Comment object by creating a duplicate on the heap and returning it.
Stringtext ()
 Returns the content/Text of this Comment object.
const Stringtext () const
 Returns the content/Text of this Comment object.
void setText (const String &text)
 Sets the Text of this Comment object.
- 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.
virtual bool operator== (const Node &) const
 Compares this Node object with the given node.

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 Comment element (Node) of an XML document, containing the comment's content.

A Comment element stores the content of a comment. There is no interpretation of the comment's Text before it is stored.

Use Text() to get the content/Text of the comment element without the <!– and –>.

When parsing a comment %<!– This is a comment –>$ the following Text will be returned by Text(): $This is a comment$

See Also
Node

Constructor & Destructor Documentation

cxxtools::xml::Comment::Comment ( const String text)
inlineexplicit

Constructs a new Comment object with the given string as content/Text.

Parameters
TextThe content/Text of the Comment object.

Member Function Documentation

Comment* cxxtools::xml::Comment::clone ( ) const
inlinevirtual

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

Returns
A cloned version of this Comment object.

Implements cxxtools::xml::Node.

void cxxtools::xml::Comment::setText ( const String text)
inline

Sets the Text of this Comment object.

Parameters
textThe new Text for this Comment object.
String& cxxtools::xml::Comment::text ( )
inline

Returns the content/Text of this Comment object.

The content includes everything that is between the start and end "tags" of the comment without being parsed. When parsing a comment %<!– This is a comment –>$ the following Text will be returned: $This is a comment$

Returns
The Text of this Comment object.
const String& cxxtools::xml::Comment::text ( ) const
inline

Returns the content/Text of this Comment object.

The content includes everything that is between the start and end "tags" of the comment without being parsed. When parsing a comment %<!– This is a comment –>$ the following Text will be returned: $This is a comment$

Returns
The Text of this Comment object.

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