|
Simbody
3.4
|
This is something we don't understand but can carry around. More...
#include <Xml.h>
Inheritance diagram for SimTK::Xml::Unknown:Public Member Functions | |
| Unknown () | |
| Create an empty Unknown node handle, suitable only for holding references to other Unknown nodes. | |
| Unknown (const String &contents) | |
| Create a new Unknown node with the given contents; the node is not yet owned by any XML document. | |
| Unknown (Element &element, const String &contents) | |
| Create a new Unknown node and append it to the list of nodes that are children of the given Element. | |
| Unknown | clone () const |
| The clone() method makes a deep copy of this Unknown node and returns a new orphan Unknown node with the same contents; ordinary assignment and copy construction are shallow. | |
| const String & | getContents () const |
| Obtain the contents of this Unknown node. | |
| void | setContents (const String &contents) |
| Change the contents of this Unknown node. | |
Public Member Functions inherited from SimTK::Xml::Node | |
| bool | operator== (const Node &other) const |
| Comparing Nodes for equality means asking if the two Node handles are referring to exactly the same object; two different nodes that happen to have the same properties will not test equal by this criteria. | |
| bool | operator!= (const Node &other) const |
| Inequality test using same criteria as operator==(). | |
| Node () | |
| Create an empty Node handle that can be used to hold a reference to any kind of Node. | |
| Node (const Node &src) | |
| Copy constructor is shallow; that is, this handle will refer to the same node as the source. | |
| Node & | operator= (const Node &src) |
| Copy assignment is shallow; the handle is first cleared and then will refer to the same node as the source. | |
| ~Node () | |
| The Node handle destructor does not recover heap space so if you create orphan nodes and then don't put them in a document there will be a memory leak unless you explicitly destruct them first with clearOrphan(). | |
| void | clear () |
| This method restores the Node handle to its default-constructed state but does not recover any heap space; use clearOrphan() if you know this node was never put into a document. | |
| void | clearOrphan () |
| This method explictly frees the heap space for an orphan node that was created but never inserted into a document. | |
| NodeType | getNodeType () const |
| Get the Xml::NodeType of this node. | |
| String | getNodeTypeAsString () const |
| Get the Node type as a string; an empty handle returns "NoNode". | |
| bool | isValid () const |
| Return true if this Node handle is referencing some node, false if the Node handle is empty. | |
| bool | isTopLevelNode () const |
| Return true if this Node is owned by the top-level Xml document, false if the Node is owned by an Element or is an orphan, or if the Node handle is empty. | |
| bool | isOrphan () const |
| Return true if this Node is an orphan, meaning that it is not empty, but is not owned by any element or top-level document. | |
| bool | hasParentElement () const |
| Return true if this node has a parent, i.e. | |
| Element | getParentElement () |
| Return a handle referencing this node's parent if it has one, otherwise throws an error; check first with hasParentElement() if you aren't sure. | |
| const String & | getNodeText () const |
| Return a text value associated with this Node (not including its child nodes if any); the behavior depends on the NodeType. | |
| void | writeToString (String &out, bool compact=false) const |
| Serialize this node (and everything it contains) to the given String. | |
Static Public Member Functions | |
Conversion to Unknown 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 an Unknown node and if so cast it to one. | |
| static bool | isA (const Node &) |
| Test whether a given Node is an Unknown node. | |
| static const Unknown & | getAs (const Node &node) |
| Recast a Node to a const Unknown, throwing an error if the Node is not actually an Unknown node. | |
| static Unknown & | getAs (Node &node) |
| Recast a writable Node to a writable Unknown, throwing an error if the Node is not actually an Unknown node. | |
Additional Inherited Members | |
Related Functions inherited from SimTK::Xml::Node | |
| std::ostream & | operator<< (std::ostream &o, const Xml::Node &xmlNode) |
| Output a "pretty printed" textual representation of the given XML node (and all its contents) to an std::ostream. | |
This is something we don't understand but can carry around.
|
inline |
|
explicit |
Create a new Unknown node with the given contents; the node is not yet owned by any XML document.
Don't include the tag delimiters "<" and ">" in the contents; those will be added automatically if the document is serialized to a file or string. That is, if you want "<!SOMETHING blah blah>", the contents you provide should be "!SOMETHING blah blah".
| Unknown SimTK::Xml::Unknown::clone | ( | ) | const |
The clone() method makes a deep copy of this Unknown node and returns a new orphan Unknown node with the same contents; ordinary assignment and copy construction are shallow.
Reimplemented from SimTK::Xml::Node.
| const String& SimTK::Xml::Unknown::getContents | ( | ) | const |
Obtain the contents of this Unknown node.
This is everything that would be between the "<" and ">" in the XML document.
| void SimTK::Xml::Unknown::setContents | ( | const String & | contents | ) |
Change the contents of this Unknown node.
This is everything that would be between the "<" and ">" in the XML document.
|
static |