Simbody
Public Member Functions

SimTK::Xml::Text Class Reference

This is the "leaf" content of an element. More...

#include <Xml.h>

Inheritance diagram for SimTK::Xml::Text:

List of all members.

Public Member Functions

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

Static Public Member Functions

Conversion to Text 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 Text node and if so cast it to one.

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

Detailed Description

This is the "leaf" content of an element.


Constructor & Destructor Documentation

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

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

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

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


Member Function Documentation

Text SimTK::Xml::Text::clone ( ) const

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

Reimplemented from SimTK::Xml::Node.

const String& SimTK::Xml::Text::getText ( ) const

Obtain a const reference to the String holding the value of this Text.

String& SimTK::Xml::Text::updText ( )

Obtain a writable reference to the String holding the value of this Text node; this can be used to alter the value.

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

Test whether a given Node is an Text node.

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

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

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

Recast a writable Node to a writable Text node, throwing an error if the Node is not actually a Text 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