DRDE/AusRegEPPTK/se/HostUpdateCommand.cpp

31 lines
959 B
C++
Raw Normal View History

2013-12-31 19:36:07 +00:00
#include "se/HostUpdateCommand.hpp"
#include "se/StandardObjectType.hpp"
#include "xml/XMLHelper.hpp"
HostUpdateCommand::HostUpdateCommand (const std::string &name,
const HostAddRem *add,
const HostAddRem *rem,
const std::string *newName)
: UpdateCommand(StandardObjectType::HOST(), name)
{
if (add)
{
DOMElement *addElement = xmlWriter->appendChild (objElement, "add");
add->appendToElement (xmlWriter, addElement);
}
if (rem)
{
DOMElement *remElement = xmlWriter->appendChild (objElement, "rem");
rem->appendToElement (xmlWriter, remElement);
}
if (newName)
{
DOMElement *chgElement = xmlWriter->appendChild (objElement, "chg");
XMLHelper::setTextContent
(xmlWriter->appendChild (chgElement, "name"), *newName);
}
}