#include <SiStripConfigWriter.h>
Public Member Functions | |
void | createChildElement (std::string tag, std::string name) |
void | createChildElement (std::string tag, std::string name, std::string att_name, std::string att_val) |
void | createChildElement (std::string tag, std::string name, std::string att_name1, std::string att_val1, std::string att_name2, std::string att_val2) |
void | createChildElement (std::string tag, std::string name, std::string att_name1, std::string att_val1, std::string att_name2, std::string att_val2, std::string att_name3, std::string att_val3) |
void | createElement (std::string tag, std::string name) |
void | createElement (std::string tag) |
bool | init (std::string main) |
Write XML file. | |
SiStripConfigWriter () | |
Creator. | |
void | write (std::string fname) |
~SiStripConfigWriter () | |
Destructor. | |
Private Attributes | |
xercesc::DOMImplementation * | domImpl |
xercesc::DOMWriter * | domWriter |
xercesc::DOMElement * | lastElement |
xercesc::DOMDocument * | theDoc |
xercesc::DOMElement * | theTopElement |
* Base class for Parsers used by DQM
Definition at line 32 of file SiStripConfigWriter.h.
SiStripConfigWriter::SiStripConfigWriter | ( | ) |
SiStripConfigWriter::~SiStripConfigWriter | ( | ) |
void SiStripConfigWriter::createChildElement | ( | std::string | tag, |
std::string | name | ||
) |
Definition at line 53 of file SiStripConfigWriter.cc.
References qtxml::_toDOMS(), lastElement, and theDoc.
Referenced by SiStripActionExecutor::printReportSummary(), and SiStripActionExecutor::printShiftHistoParameters().
{ lastElement->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n"))); xercesc::DOMElement* newElement = theDoc->createElement(qtxml::_toDOMS(tag)); newElement->setAttribute(qtxml::_toDOMS("name"), qtxml::_toDOMS(name)); lastElement->appendChild(newElement); }
void SiStripConfigWriter::createChildElement | ( | std::string | tag, |
std::string | name, | ||
std::string | att_name1, | ||
std::string | att_val1, | ||
std::string | att_name2, | ||
std::string | att_val2, | ||
std::string | att_name3, | ||
std::string | att_val3 | ||
) |
Definition at line 89 of file SiStripConfigWriter.cc.
References qtxml::_toDOMS(), lastElement, and theDoc.
{ lastElement->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n"))); xercesc::DOMElement* newElement = theDoc->createElement(qtxml::_toDOMS(tag)); newElement->setAttribute(qtxml::_toDOMS("name"), qtxml::_toDOMS(name)); newElement->setAttribute(qtxml::_toDOMS(att_name1), qtxml::_toDOMS(att_val1)); newElement->setAttribute(qtxml::_toDOMS(att_name2), qtxml::_toDOMS(att_val2)); newElement->setAttribute(qtxml::_toDOMS(att_name3), qtxml::_toDOMS(att_val3)); lastElement->appendChild(newElement); }
void SiStripConfigWriter::createChildElement | ( | std::string | tag, |
std::string | name, | ||
std::string | att_name1, | ||
std::string | att_val1, | ||
std::string | att_name2, | ||
std::string | att_val2 | ||
) |
Definition at line 76 of file SiStripConfigWriter.cc.
References qtxml::_toDOMS(), lastElement, and theDoc.
{ lastElement->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n"))); xercesc::DOMElement* newElement = theDoc->createElement(qtxml::_toDOMS(tag)); newElement->setAttribute(qtxml::_toDOMS("name"), qtxml::_toDOMS(name)); newElement->setAttribute(qtxml::_toDOMS(att_name1), qtxml::_toDOMS(att_val1)); newElement->setAttribute(qtxml::_toDOMS(att_name2), qtxml::_toDOMS(att_val2)); lastElement->appendChild(newElement); }
void SiStripConfigWriter::createChildElement | ( | std::string | tag, |
std::string | name, | ||
std::string | att_name, | ||
std::string | att_val | ||
) |
Definition at line 63 of file SiStripConfigWriter.cc.
References qtxml::_toDOMS(), lastElement, and theDoc.
{ lastElement->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n"))); xercesc::DOMElement* newElement = theDoc->createElement(qtxml::_toDOMS(tag)); newElement->setAttribute(qtxml::_toDOMS("name"), qtxml::_toDOMS(name)); newElement->setAttribute(qtxml::_toDOMS(att_name), qtxml::_toDOMS(att_val)); lastElement->appendChild(newElement); }
void SiStripConfigWriter::createElement | ( | std::string | tag, |
std::string | name | ||
) |
Definition at line 44 of file SiStripConfigWriter.cc.
References qtxml::_toDOMS(), lastElement, theDoc, and theTopElement.
{ theTopElement->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n"))); lastElement = theDoc->createElement(qtxml::_toDOMS(tag)); lastElement->setAttribute(qtxml::_toDOMS("name"), qtxml::_toDOMS(name)); theTopElement->appendChild(lastElement); }
void SiStripConfigWriter::createElement | ( | std::string | tag | ) |
Definition at line 36 of file SiStripConfigWriter.cc.
References qtxml::_toDOMS(), lastElement, theDoc, and theTopElement.
Referenced by SiStripActionExecutor::createShiftReport(), and SiStripActionExecutor::printShiftHistoParameters().
{ theTopElement->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n"))); lastElement = theDoc->createElement(qtxml::_toDOMS(tag)); theTopElement->appendChild(lastElement); }
bool SiStripConfigWriter::init | ( | std::string | main | ) |
Write XML file.
Definition at line 20 of file SiStripConfigWriter.cc.
References qtxml::_toDOMS(), domImpl, domWriter, theDoc, and theTopElement.
Referenced by SiStripActionExecutor::createShiftReport().
{ xercesc::XMLPlatformUtils::Initialize(); xercesc::DOMImplementation* domImpl = xercesc::DOMImplementationRegistry::getDOMImplementation(qtxml::_toDOMS("Range")); if (!domImpl) return false; domWriter = (dynamic_cast<xercesc::DOMImplementation*>(domImpl))->createDOMWriter(); if (!domWriter) return false; domWriter->canSetFeature(xercesc::XMLUni::fgDOMWRTFormatPrettyPrint, true); theDoc = domImpl->createDocument(0,qtxml::_toDOMS(main), 0); if (!theDoc) return false; theTopElement = theDoc->getDocumentElement(); return true; }
void SiStripConfigWriter::write | ( | std::string | fname | ) |
Definition at line 105 of file SiStripConfigWriter.cc.
References domWriter, theDoc, and theTopElement.
Referenced by SiStripActionExecutor::createShiftReport().
{ xercesc::XMLFormatTarget* formTarget = new xercesc::LocalFileFormatTarget(fname.c_str()); domWriter->writeNode(formTarget, *theTopElement); delete formTarget; theDoc->release(); }
xercesc::DOMImplementation* SiStripConfigWriter::domImpl [private] |
Definition at line 61 of file SiStripConfigWriter.h.
Referenced by init().
xercesc::DOMWriter* SiStripConfigWriter::domWriter [private] |
Definition at line 62 of file SiStripConfigWriter.h.
xercesc::DOMElement* SiStripConfigWriter::lastElement [private] |
Definition at line 59 of file SiStripConfigWriter.h.
Referenced by createChildElement(), and createElement().
xercesc::DOMDocument* SiStripConfigWriter::theDoc [private] |
Definition at line 60 of file SiStripConfigWriter.h.
Referenced by createChildElement(), createElement(), init(), and write().
xercesc::DOMElement* SiStripConfigWriter::theTopElement [private] |
Definition at line 58 of file SiStripConfigWriter.h.
Referenced by createElement(), init(), and write().