API
4.0
For C++ developers
|
Public Member Functions | |
virtual | ~XMLDocument () |
XMLDocument () | |
XMLDocument (const std::string &aFileName) | |
XMLDocument (const XMLDocument &aDocument) | |
void | copyDefaultObjects (const XMLDocument &aDocument) |
void | writeDefaultObjects (SimTK::Xml::Element &elmt) |
const int & | getDocumentVersion () const |
SimTK::Xml::Element | getRootDataElement () |
bool | isEqualTo (XMLDocument &aOtherDocument, double toleranceForDoubles=1e-6, bool compareDefaults=false, bool compareVersionNumbers=false) |
void | setFileName (const std::string &aFileName) |
const std::string & | getFileName () const |
void | addDefaultObject (OpenSim::Object *aDefaultObject) |
bool | hasDefaultObjects () const |
bool | print (const std::string &aFileName=NULL) |
Public Member Functions inherited from SimTK::Xml::Document | |
Document () | |
Document (const String &pathname) | |
Document (const Document &source) | |
Document & | operator= (const Document &souce) |
~Document () | |
void | clear () |
Element | getRootElement () |
const String & | getRootTag () const |
void | setRootTag (const String &tag) |
void | insertTopLevelNodeAfter (const node_iterator &afterThis, Node insertThis) |
void | insertTopLevelNodeBefore (const node_iterator &beforeThis, Node insertThis) |
void | eraseTopLevelNode (const node_iterator &deleteThis) |
Node | removeTopLevelNode (const node_iterator &removeThis) |
node_iterator | node_begin (NodeType allowed=AnyNodes) |
node_iterator | node_end () const |
String | getXmlVersion () const |
String | getXmlEncoding () const |
bool | getXmlIsStandalone () const |
void | setXmlVersion (const String &version) |
void | setXmlEncoding (const String &encoding) |
void | setXmlIsStandalone (bool isStandalone) |
std::ostream & | operator<< (std::ostream &o, const Document &doc) |
Document () | |
Document (const String &pathname) | |
Document (const Document &source) | |
Document & | operator= (const Document &souce) |
~Document () | |
void | clear () |
void | readFromFile (const String &pathname) |
void | writeToFile (const String &pathname) const |
void | readFromString (const String &xmlDocument) |
void | readFromString (const char *xmlDocument) |
void | writeToString (String &xmlDocument, bool compact=false) const |
void | setIndentString (const String &indent) |
const String & | getIndentString () const |
Element | getRootElement () |
const String & | getRootTag () const |
void | setRootTag (const String &tag) |
void | insertTopLevelNodeAfter (const node_iterator &afterThis, Node insertThis) |
void | insertTopLevelNodeBefore (const node_iterator &beforeThis, Node insertThis) |
void | eraseTopLevelNode (const node_iterator &deleteThis) |
Node | removeTopLevelNode (const node_iterator &removeThis) |
node_iterator | node_begin (NodeType allowed=AnyNodes) |
node_iterator | node_end () const |
String | getXmlVersion () const |
String | getXmlEncoding () const |
bool | getXmlIsStandalone () const |
void | setXmlVersion (const String &version) |
void | setXmlEncoding (const String &encoding) |
void | setXmlIsStandalone (bool isStandalone) |
Static Public Member Functions | |
static const int & | getLatestVersion () |
static void | renameChildNode (SimTK::Xml::Element &aNode, std::string oldElementName, std::string newElementName) |
static void | getVersionAsString (const int aVersion, std::string &aString) |
static void | addConnector (SimTK::Xml::Element &element, const std::string &connectorTag, const std::string &connectorName, const std::string &connectorValue) |
This adds an XML element to element of the following form: More... | |
static void | updateConnectors30508 (SimTK::Xml::Element &componentElt) |
In version 30508, the XML syntax for Connectors changed: Previous: More... | |
static void | addPhysicalOffsetFrame30505_30517 (SimTK::Xml::Element &element, const std::string &frameName, const std::string &parentFrameName, const SimTK::Vec3 &location, const SimTK::Vec3 &orientation) |
static std::string | updateConnecteePath30517 (const std::string &connecteeSetName, const std::string &connecteeName) |
Convert component names into the appropriate paths based on where we know components were located in version 30000 model files. More... | |
static SimTK::Xml::Element | findElementWithName (SimTK::Xml::Element &element, const std::string &name) |
Find the first XML Element (depth-first search) with the provided name , anywhere in the XML document that contains element . More... | |
Static Public Member Functions inherited from SimTK::Xml::Document | |
static void | setXmlCondenseWhiteSpace (bool shouldCondense) |
static bool | isXmlWhiteSpaceCondensed () |
Static Public Attributes | |
static const int | LatestVersion |
Latest version of the code encoded as an int xxyyzz where x: major release, y: minor, z: patch. More... | |
|
virtual |
OpenSim::XMLDocument::XMLDocument | ( | ) |
OpenSim::XMLDocument::XMLDocument | ( | const std::string & | aFileName | ) |
OpenSim::XMLDocument::XMLDocument | ( | const XMLDocument & | aDocument | ) |
|
static |
This adds an XML element to element
of the following form:
This syntax was revised in XML document version 30508; see updateConnectors30508(). As such, this function should not be used for updating versions 30508 or greater.
void OpenSim::XMLDocument::addDefaultObject | ( | OpenSim::Object * | aDefaultObject | ) |
|
static |
void OpenSim::XMLDocument::copyDefaultObjects | ( | const XMLDocument & | aDocument | ) |
|
static |
Find the first XML Element (depth-first search) with the provided name
, anywhere in the XML document that contains element
.
If the XML document does not contain an element with name name
, or if name
is empty, then the returned Xml::Element is empty (Xml::Element::isValid() returns false).
|
inline |
const std::string& OpenSim::XMLDocument::getFileName | ( | ) | const |
|
inlinestatic |
Referenced by OpenSim::Appearance::updateFromXMLNode().
SimTK::Xml::Element OpenSim::XMLDocument::getRootDataElement | ( | ) |
|
static |
|
inline |
References OpenSim::Array< T >::getSize().
bool OpenSim::XMLDocument::isEqualTo | ( | XMLDocument & | aOtherDocument, |
double | toleranceForDoubles = 1e-6 , |
||
bool | compareDefaults = false , |
||
bool | compareVersionNumbers = false |
||
) |
bool OpenSim::XMLDocument::print | ( | const std::string & | aFileName = NULL | ) |
|
static |
void OpenSim::XMLDocument::setFileName | ( | const std::string & | aFileName | ) |
|
static |
Convert component names into the appropriate paths based on where we know components were located in version 30000 model files.
depth | What's the tree depth of the component containing the relevant socket? |
connecteeSetName | "bodyset", "jointset", etc. |
connecteeName | The name of the connectee from the version 30000 file. Note: It is okay for connecteePath to be a reference to connecteeName. |
|
static |
In version 30508, the XML syntax for Connectors changed: Previous:
New:
If there is no <connectors>
element, then this function does not edit componentElt.
void OpenSim::XMLDocument::writeDefaultObjects | ( | SimTK::Xml::Element & | elmt | ) |
|
static |
Latest version of the code encoded as an int xxyyzz where x: major release, y: minor, z: patch.