RobWorkProject  23.9.11-
Classes | Static Public Member Functions | List of all members
DOMCorePropertyMapSaver Class Reference

Class for saving rw::core::PropertyMap to XML. More...

#include <DOMCorePropertyMapSaver.hpp>

Classes

class  Initializer
 Utility class which initializes local static variables. More...
 

Static Public Member Functions

static void save (rw::core::Ptr< rw::core::PropertyBase > property, rw::core::DOMElem::Ptr parent)
 Writes a single property to a DOMElement. More...
 
static void save (const rw::core::PropertyMap &map, rw::core::DOMElem::Ptr parent)
 Saves properties of a PropertyMap as childs to element. More...
 
static void save (const rw::core::PropertyMap &map, const std::string &filename)
 Saves the properties of map to file named filename. More...
 
static void write (const rw::core::PropertyMap &map, std::ostream &outstream)
 Writes the properties of map to outstream. More...
 
static rw::core::DOMElem::Ptr createDOMDocument (const rw::core::PropertyMap &map, rw::core::Ptr< rw::core::DOMParser > parser)
 Creates DOMDocument for map. More...
 

Detailed Description

Class for saving rw::core::PropertyMap to XML.

The saver is capable of saving all types defined in rw::core::PropertyType.

Implemented using RobWork DOM parser abstraction.

Member Function Documentation

◆ createDOMDocument()

static rw::core::DOMElem::Ptr createDOMDocument ( const rw::core::PropertyMap map,
rw::core::Ptr< rw::core::DOMParser parser 
)
static

Creates DOMDocument for map.

Exceptions
rw::core::Exceptionif the type of a property is not supported.
Parameters
map[in] Map of properties
parser[in] DOMParser to use
Returns
DOMDocument containing properties.

◆ save() [1/3]

static void save ( const rw::core::PropertyMap map,
const std::string &  filename 
)
static

Saves the properties of map to file named filename.

Exceptions
rw::core::Exceptionif the type of a property is not supported.
Parameters
map[in] Map of properties to save
filename[in] Filename

◆ save() [2/3]

static void save ( const rw::core::PropertyMap map,
rw::core::DOMElem::Ptr  parent 
)
static

Saves properties of a PropertyMap as childs to element.

Constructs element representing the properties in map and adds these as childs to element.

Throws rw::core::Expcetion if the type of a property is not supported.

Parameters
map[in] Map of properties to save.
parent[in] DOMDocument which should contain the PropertyMap representation

◆ save() [3/3]

static void save ( rw::core::Ptr< rw::core::PropertyBase property,
rw::core::DOMElem::Ptr  parent 
)
static

Writes a single property to a DOMElement.

Constructs a new DOMElement for the document parent and writes the property to it.

Exceptions
rw::core::Exceptionif the type of the property is not supported.
Parameters
property[in] Property to save
parent[in] DOMDocument which should contain the property representation

◆ write()

static void write ( const rw::core::PropertyMap map,
std::ostream &  outstream 
)
static

Writes the properties of map to outstream.

Exceptions
rw::core::Exceptionif the type of a property is not supported.
Parameters
map[in] Map of properties to save
outstream[in] Output stream

The documentation for this class was generated from the following file: