SOFA API  1c8b807d
Open source framework for multi-physics simuation
sofa::simulation::xml Namespace Reference

Classes

class  AttributeElement
 
class  BaseElement
 
class  BaseMultiMappingElement
 
class  DataElement
 
class  Element
 
class  NodeElement
 
class  ObjectElement
 

Enumerations

enum  IncludeNodeType { INCLUDE_NODE_CHILD , INCLUDE_NODE_GROUP , INCLUDE_NODE_MERGE }
 Flags indicating when an element is from an included file that should be treated specifically. More...
 

Functions

void recReplaceAttribute (BaseElement *node, const char *attr, const char *value, const char *nodename=nullptr)
 
BaseElementincludeNode (tinyxml2::XMLNode *root, const char *basefilename)
 
BaseElementattributeNode (tinyxml2::XMLNode *root, const char *basefilename)
 
void recursiveMergeNode (BaseElement *destNode, BaseElement *srcNode)
 
BaseElementcreateNode (tinyxml2::XMLNode *root, const char *basefilename, bool isRoot=false)
 
BaseElementprocessXMLLoading (const char *filename, const tinyxml2::XMLDocument &doc, bool fromMem)
 
BaseElementloadFromMemory (const char *filename, const char *data)
 
BaseElementloadFromFile (const char *filename)
 
SOFA_SIMULATION_COMMON_API bool save (const char *filename, BaseElement *root)
 

Variables

Creator< BaseElement::NodeFactory, AttributeElementAttributeNodeClass ("Attribute")
 
Creator< BaseElement::NodeFactory, DataElementDataNodeClass ("Data")
 
helper::Creator< BaseElement::NodeFactory, NodeElementNodeNodeClass ("Node")
 
Creator< BaseElement::NodeFactory, ObjectElementObjectNodeClass ("Object")
 
int numDefault =0
 

Enumeration Type Documentation

◆ IncludeNodeType

Flags indicating when an element is from an included file that should be treated specifically.

Enumerator
INCLUDE_NODE_CHILD 

indicating a standard node that should be used as child

INCLUDE_NODE_GROUP 

indicating a node that should be removed, and its content added within the parent node

INCLUDE_NODE_MERGE 

indicating a node that should be merged with its parent, and any child node with the same name as an existing child should be recursively merged

Function Documentation

◆ attributeNode()

BaseElement* sofa::simulation::xml::attributeNode ( tinyxml2::XMLNode *  root,
const char basefilename 
)

◆ createNode()

BaseElement* sofa::simulation::xml::createNode ( tinyxml2::XMLNode *  root,
const char basefilename,
bool  isRoot = false 
)

◆ includeNode()

BaseElement * sofa::simulation::xml::includeNode ( tinyxml2::XMLNode *  root,
const char basefilename 
)

◆ loadFromFile()

SOFA_SIMULATION_COMMON_API BaseElement * sofa::simulation::xml::loadFromFile ( const char filename)

◆ loadFromMemory()

SOFA_SIMULATION_COMMON_API BaseElement * sofa::simulation::xml::loadFromMemory ( const char filename,
const char data 
)

◆ processXMLLoading()

SOFA_SIMULATION_COMMON_API BaseElement * sofa::simulation::xml::processXMLLoading ( const char filename,
const tinyxml2::XMLDocument &  doc,
bool  fromMem 
)

◆ recReplaceAttribute()

void sofa::simulation::xml::recReplaceAttribute ( BaseElement node,
const char attr,
const char value,
const char nodename = nullptr 
)

◆ recursiveMergeNode()

void sofa::simulation::xml::recursiveMergeNode ( BaseElement destNode,
BaseElement srcNode 
)

◆ save()

SOFA_SIMULATION_COMMON_API bool sofa::simulation::xml::save ( const char filename,
BaseElement root 
)

Variable Documentation

◆ AttributeNodeClass

Creator<BaseElement::NodeFactory, AttributeElement> sofa::simulation::xml::AttributeNodeClass("Attribute") ( "Attribute"  )

◆ DataNodeClass

Creator<BaseElement::NodeFactory, DataElement> sofa::simulation::xml::DataNodeClass("Data") ( "Data"  )

◆ NodeNodeClass

helper::Creator<BaseElement::NodeFactory, NodeElement> sofa::simulation::xml::NodeNodeClass("Node") ( "Node"  )

◆ numDefault

int SOFA_SIMULATION_COMMON_API sofa::simulation::xml::numDefault =0

◆ ObjectNodeClass

Creator<BaseElement::NodeFactory, ObjectElement> sofa::simulation::xml::ObjectNodeClass("Object") ( "Object"  )