21#ifndef MAPPING_CONFIGURATION_TO_XML_BASE_H_INCLUDED
22#define MAPPING_CONFIGURATION_TO_XML_BASE_H_INCLUDED
42template <
typename DomNodeType>
56 const char* attribute_name,
60 dom_node.setAttribute(attribute_name, std::to_string(*value));
77 const char* attribute_name,
78 const std::string& value)
81 dom_node.setAttribute(attribute_name, value);
94 const std::string& sub_node_name,
95 const std::string& value)
97 DomNodeType sub_node = dom_node.createChild(sub_node_name);
98 sub_node.setData(value);
108 const std::string& sub_node_name,
109 const std::string& value)
111 if (!value.empty()) {
definition of the mapping namespace
Definition ddl.h:50
definition of the ddl namespace
Definition codec.h:21
An optional template as long as the std::optional is not available here.
Definition access_optional.h:31
Template class to create MappingConfiguration DOM nodes with the help of the type DomNodeType.
Definition datamodel_xml_configurationtoxml_base.h:43
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.
Definition datamodel_xml_configurationtoxml_base.h:76
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.
Definition datamodel_xml_configurationtoxml_base.h:55
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.
Definition datamodel_xml_configurationtoxml_base.h:107
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.
Definition datamodel_xml_configurationtoxml_base.h:93