DRDE/ACTK1_0/se/LPE/LPChkCmdExtension.cpp

30 lines
939 B
C++
Raw Normal View History

2014-01-24 20:49:09 +00:00
#include "se/LPE/LPChkCmdExtension.hpp"
#include "se/Command.hpp"
#include "se/LPE/LPExtension.hpp"
2014-01-28 18:16:48 +00:00
#include "se/LPE/SMDExtension.hpp"
2014-01-24 20:49:09 +00:00
#include "xml/XMLHelper.hpp"
namespace {
2014-01-28 18:16:48 +00:00
2014-01-24 20:49:09 +00:00
LPExtension& lpExtension() {
static LPExtension* lpExtension = new LPExtension();
return *lpExtension;
}
2014-01-28 18:16:48 +00:00
SMDExtension& smdExtension() {
static SMDExtension* smdExtension = new SMDExtension();
return *smdExtension;
}
2014-01-24 20:49:09 +00:00
}; // anonymous namespace
void LPChkCmdExtension::addToCommand(const Command &command) const
{
XMLWriter* xmlWriter = command.getXmlWriter();
DOMElement* extensionElement = command.getExtensionElement();
DOMElement* launchElement = xmlWriter->appendChild(extensionElement,
2014-01-24 22:17:21 +00:00
"check", lpExtension().getURI());
2014-01-24 20:49:09 +00:00
DOMElement* exPhaseElement = xmlWriter->appendChild(launchElement, "launch:phase");
XMLHelper::setTextContent(exPhaseElement, lpePhaseName);
}