Dev Essential  1.6.3
Loading...
Searching...
No Matches
ddl::mapping::MappingConfigurationToXMLFactoryBase< DomNodeType > Struct Template Reference

Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType. More...

#include <datamodel_xml_configurationtoxml_base.h>

Static Public Member Functions

template<typename T>
static bool setOptionalAttribute (DomNodeType &dom_node, const char *attribute_name, const utility::Optional< T > &value)
 Set the Optional Attribute. This will only set the attribute if the value is valid.
 
static bool setOptionalAttribute (DomNodeType &dom_node, const char *attribute_name, const std::string &value)
 Set the Optional Attribute. This will only set the attribute if the value is not empty.
 
static void setSubNodeData (DomNodeType &dom_node, const std::string &sub_node_name, const std::string &value)
 Set the data of the new created tag with the name sub_node_name.
 
static void setOptionalSubNodeData (DomNodeType &dom_node, const std::string &sub_node_name, const std::string &value)
 Set the data of the new created tag with the name sub_node_name.
 

Detailed Description

template<typename DomNodeType>
struct ddl::mapping::MappingConfigurationToXMLFactoryBase< DomNodeType >

Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType.

Template Parameters
DomNodeTypeThe type for the DOM Node which must follow the concept of implementing functions:
  • setAttribute(const std::string& name, const std::string& value);
  • DomNodeType& createChild(const std::string& name);
  • setData(const std::string& name, const std::string& data);

Member Function Documentation

◆ setOptionalAttribute() [1/2]

template<typename DomNodeType>
static bool ddl::mapping::MappingConfigurationToXMLFactoryBase< DomNodeType >::setOptionalAttribute ( DomNodeType & dom_node,
const char * attribute_name,
const std::string & value )
inlinestatic

Set the Optional Attribute. This will only set the attribute if the value is not empty.

Parameters
dom_nodethe dom node where to set the attribute
attribute_namethe attribute name
valuethe value of the attribute
Returns
true the value was set
false the value was not set

◆ setOptionalAttribute() [2/2]

template<typename DomNodeType>
template<typename T>
static bool ddl::mapping::MappingConfigurationToXMLFactoryBase< DomNodeType >::setOptionalAttribute ( DomNodeType & dom_node,
const char * attribute_name,
const utility::Optional< T > & value )
inlinestatic

Set the Optional Attribute. This will only set the attribute if the value is valid.

Template Parameters
TThe value_type of the optional
Parameters
dom_nodethe dom node where to set the attribute
attribute_namethe attribute name
valuethe value of the attribute
Returns
true the value was set
false the value was not set

◆ setOptionalSubNodeData()

template<typename DomNodeType>
static void ddl::mapping::MappingConfigurationToXMLFactoryBase< DomNodeType >::setOptionalSubNodeData ( DomNodeType & dom_node,
const std::string & sub_node_name,
const std::string & value )
inlinestatic

Set the data of the new created tag with the name sub_node_name.

Parameters
dom_nodethe dom node where to set the attribute
sub_node_namethe subnode tag name
valuethe data content

◆ setSubNodeData()

template<typename DomNodeType>
static void ddl::mapping::MappingConfigurationToXMLFactoryBase< DomNodeType >::setSubNodeData ( DomNodeType & dom_node,
const std::string & sub_node_name,
const std::string & value )
inlinestatic

Set the data of the new created tag with the name sub_node_name.

Parameters
dom_nodethe dom node where to set the attribute
sub_node_namethe subnode tag name
valuethe data content

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