interface for all classes able to write themselves to XML files
More...
#include <mitkXMLSerializable.h>
|
virtual const char * | GetNameOfClass () const =0 |
|
virtual void | ToXML (tinyxml2::XMLElement *elem) const =0 |
|
virtual void | FromXML (const tinyxml2::XMLElement *elem)=0 |
|
virtual void | ToXMLFile (const std::string &file, const std::string &elemName="") |
|
virtual void | FromXMLFile (const std::string &file, const std::string &elemName="") |
|
std::string | GetXMLFileName () const |
|
interface for all classes able to write themselves to XML files
Definition at line 30 of file mitkXMLSerializable.h.
◆ FromXML()
virtual void mitk::XMLSerializable::FromXML |
( |
const tinyxml2::XMLElement * |
elem | ) |
|
|
pure virtual |
◆ FromXMLFile()
virtual void mitk::XMLSerializable::FromXMLFile |
( |
const std::string & |
file, |
|
|
const std::string & |
elemName = "" |
|
) |
| |
|
virtual |
loads the XML file and calls FromXML() takes the first child of the document if this root node value is not equal to GetNameOfClass() the method will try to find the first children of the root node with the value of GetNameOfClass() if elemName is not empty then this value will be used instead of GetNameOfClass() if this node is found it will check if an attribute named FILE_REFERENCE_ATTRIBUTE_NAME is found: in this case the method calls itself with this attributes value as parameter
◆ GetNameOfClass()
virtual const char* mitk::XMLSerializable::GetNameOfClass |
( |
| ) |
const |
|
pure virtual |
the tag value will be equals to the class name (function implemented by the itkTypeMacro)
◆ GetXMLFileName()
std::string mitk::XMLSerializable::GetXMLFileName |
( |
| ) |
const |
◆ ToXML()
virtual void mitk::XMLSerializable::ToXML |
( |
tinyxml2::XMLElement * |
elem | ) |
const |
|
pure virtual |
◆ ToXMLFile()
virtual void mitk::XMLSerializable::ToXMLFile |
( |
const std::string & |
file, |
|
|
const std::string & |
elemName = "" |
|
) |
| |
|
virtual |
tries to write the xml data obtained in ToXML() to file
◆ FILE_REFERENCE_ATTRIBUTE_NAME
const std::string mitk::XMLSerializable::FILE_REFERENCE_ATTRIBUTE_NAME |
|
static |
value of the special tag for file references if this is attribute is found the class will be loaded from the file in the attributes value
Definition at line 38 of file mitkXMLSerializable.h.
◆ ROOT_NAME
const std::string mitk::XMLSerializable::ROOT_NAME |
|
static |
the name of the root node that is created when the element is saved
Definition at line 42 of file mitkXMLSerializable.h.
The documentation for this class was generated from the following file: