Simbody
Public Member Functions

SimTK::Xml::Comment Class Reference

A comment contains only uninterpreted text. More...

#include <Xml.h>

Inheritance diagram for SimTK::Xml::Comment:

List of all members.

Public Member Functions

 Comment ()
 Create an empty Comment node handle, suitable only for holding references to other Comment nodes.
 Comment (const String &text)
 Create a new Comment node with the given text; the node is not yet owned by any XML document.
Comment clone () const
 The clone() method makes a deep copy of this Comment node and returns a new orphan Comment node with the same contents; ordinary assignment and copy construction are shallow.

Static Public Member Functions

Conversion to Comment from Node

If you have a handle to a Node, such as would be returned by a node_iterator, you can check whether that Node is a Comment node and if so cast it to one.

static bool isA (const Node &)
 Test whether a given Node is an Comment node.
static const CommentgetAs (const Node &node)
 Recast a Node to a const Comment, throwing an error if the Node is not actually an Comment node.
static CommentgetAs (Node &node)
 Recast a writable Node to a writable Comment, throwing an error if the Node is not actually an Comment node.

Detailed Description

A comment contains only uninterpreted text.


Constructor & Destructor Documentation

SimTK::Xml::Comment::Comment ( ) [inline]

Create an empty Comment node handle, suitable only for holding references to other Comment nodes.

SimTK::Xml::Comment::Comment ( const String text) [explicit]

Create a new Comment node with the given text; the node is not yet owned by any XML document.

Don't include the comment delimiters "<!--" and "-->" in the text; those will be added automatically if the document is serialized to a file or string.


Member Function Documentation

Comment SimTK::Xml::Comment::clone ( ) const

The clone() method makes a deep copy of this Comment node and returns a new orphan Comment node with the same contents; ordinary assignment and copy construction are shallow.

Reimplemented from SimTK::Xml::Node.

static bool SimTK::Xml::Comment::isA ( const Node ) [static]

Test whether a given Node is an Comment node.

static const Comment& SimTK::Xml::Comment::getAs ( const Node node) [static]

Recast a Node to a const Comment, throwing an error if the Node is not actually an Comment node.

See also:
isA()
static Comment& SimTK::Xml::Comment::getAs ( Node node) [static]

Recast a writable Node to a writable Comment, throwing an error if the Node is not actually an Comment node.

See also:
isA()

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines