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

Class for loading rw::core::PropertyMap from XML. More...

#include <DOMPropertyMapLoader.hpp>

Classes

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

Static Public Member Functions

static rw::core::PropertyValueBase::Ptr readPropertyValue (rw::core::Ptr< rw::core::DOMElem > element)
 Reads in a PropertyValue from DOMElement. More...
 
static rw::core::PropertyBase::Ptr readProperty (rw::core::Ptr< rw::core::DOMElem > element, bool checkHeader=true)
 Reads in a Property from DOMElement. More...
 
static rw::core::PropertyMap readProperties (rw::core::Ptr< rw::core::DOMElem > element, bool checkHeader=true)
 Reads in a PropertyMap from DOMElement. More...
 
static bool hasProperties (rw::core::Ptr< rw::core::DOMElem > element)
 
static rw::core::PropertyMap load (const std::string &filename, const std::string &schemaFileName="")
 Read in rw::core::PropertyMap from file. More...
 
static rw::core::PropertyMap load (std::istream &instream, const std::string &schemaFileName="")
 Read in rw::core::PropertyMap from istream. More...
 

Detailed Description

Class for loading rw::core::PropertyMap from XML.

The loader is capable of loading all type defined in rw::core::PropertyType.

Implemented using RobWork DOM parser abstraction.

Member Function Documentation

◆ load() [1/2]

static rw::core::PropertyMap load ( const std::string &  filename,
const std::string &  schemaFileName = "" 
)
static

Read in rw::core::PropertyMap from file.

Throws rw::core::Exception if an error occurs

Parameters
filename[in] File to load
schemaFileName[in] Name of the schema to use. If empty it will use the schema specified in the XML-file if available.
Returns
Loaded PropertyMap

◆ load() [2/2]

static rw::core::PropertyMap load ( std::istream &  instream,
const std::string &  schemaFileName = "" 
)
static

Read in rw::core::PropertyMap from istream.

Throws rw::core::Exception if an error occurs

Parameters
instream[in] Input stream to read from
schemaFileName[in] Name of the schema to use. If empty it will use the schema specified in the XML-file if available.
Returns
Loaded PropertyMap

◆ readProperties()

static rw::core::PropertyMap readProperties ( rw::core::Ptr< rw::core::DOMElem element,
bool  checkHeader = true 
)
static

Reads in a PropertyMap from DOMElement.

May throw rw::core::Exception

Parameters
element[in] DOMElement describing PropertyMap
checkHeader[in] True to check that the header of element matches XMLPropertyFormat::PropertyMapId
Returns
Loaded PropertyMap

◆ readProperty()

static rw::core::PropertyBase::Ptr readProperty ( rw::core::Ptr< rw::core::DOMElem element,
bool  checkHeader = true 
)
static

Reads in a Property from DOMElement.

May throw rw::core::Exception

Parameters
element[in] DOMElement describing Property
checkHeader[in] True to check that the header of element matches XMLPropertyFormat::PropertyId
Returns
Pointer to the property

◆ readPropertyValue()

static rw::core::PropertyValueBase::Ptr readPropertyValue ( rw::core::Ptr< rw::core::DOMElem element)
static

Reads in a PropertyValue from DOMElement.

May throw rw::core::Exception

Parameters
element[in] DOMElement describing Property
Returns
Pointer to the property value.

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