CMS 3D CMS Logo

Public Member Functions | Private Attributes

SiPixelConfigWriter Class Reference

#include <SiPixelConfigWriter.h>

List of all members.

Public Member Functions

void createColumn (std::string &element, std::string &name)
void createLayout (std::string &name)
void createRow ()
bool init ()
 Write XML file.
 SiPixelConfigWriter ()
 Creator.
void write (std::string &fname)
 ~SiPixelConfigWriter ()
 Destructor.

Private Attributes

xercesc::DOMImplementation * domImpl
xercesc::DOMWriter * domWriter
xercesc::DOMElement * lastLayout
xercesc::DOMElement * lastRow
xercesc::DOMDocument * theDoc
xercesc::DOMElement * theTopElement

Detailed Description

* Base class for Parsers used by DQM

Date:
2007/02/20 21:29:25
Revision:
1.2
Author:
Petra Merkel

Definition at line 30 of file SiPixelConfigWriter.h.


Constructor & Destructor Documentation

SiPixelConfigWriter::SiPixelConfigWriter ( )

Creator.

Definition at line 11 of file SiPixelConfigWriter.cc.

                                         {
}
SiPixelConfigWriter::~SiPixelConfigWriter ( )

Destructor.

Definition at line 16 of file SiPixelConfigWriter.cc.

                                          {

}

Member Function Documentation

void SiPixelConfigWriter::createColumn ( std::string &  element,
std::string &  name 
)

Definition at line 59 of file SiPixelConfigWriter.cc.

References qtxml::_toDOMS().

Referenced by SiPixelActionExecutor::fillLayout().

                                                                    {

   lastRow->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n")));
   DOMElement* e1 = theDoc->createElement(qtxml::_toDOMS("column"));
   lastRow->appendChild(e1);

 
   DOMElement* e2 = theDoc->createElement(qtxml::_toDOMS(element));
   e2->setAttribute(qtxml::_toDOMS("name"),qtxml::_toDOMS(name));
   e1->appendChild(e2);
 }
void SiPixelConfigWriter::createLayout ( std::string &  name)

Definition at line 41 of file SiPixelConfigWriter.cc.

References qtxml::_toDOMS().

Referenced by SiPixelActionExecutor::createLayout().

                                                   {
  lastLayout = theDoc->createElement(qtxml::_toDOMS("layout"));
  lastLayout->setAttribute(qtxml::_toDOMS("name"), qtxml::_toDOMS(name));
  theTopElement->appendChild(lastLayout);
}
void SiPixelConfigWriter::createRow ( )

Definition at line 49 of file SiPixelConfigWriter.cc.

References qtxml::_toDOMS().

Referenced by SiPixelActionExecutor::createLayout(), and SiPixelActionExecutor::fillLayout().

                                    {
  lastLayout->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n")));

  lastRow = theDoc->createElement(qtxml::_toDOMS("row"));
  lastLayout->appendChild(lastRow);
  lastLayout->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n")));
}
bool SiPixelConfigWriter::init ( void  )

Write XML file.

Definition at line 22 of file SiPixelConfigWriter.cc.

References qtxml::_toDOMS(), and gather_cfg::cout.

Referenced by SiPixelActionExecutor::createLayout().

                               {
  try {
    XMLPlatformUtils::Initialize();
  }
  catch (const XMLException& toCatch) {
    cout << "Problem to initialise XML !!! " << endl;
    return false;
  }
  DOMImplementation* domImpl = DOMImplementationRegistry::getDOMImplementation(qtxml::_toDOMS("Range"));
  domWriter = (dynamic_cast<DOMImplementation*>(domImpl))->createDOMWriter();
  domWriter->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
  theDoc = domImpl->createDocument(0,qtxml::_toDOMS("Layouts"), 0);
  theTopElement = theDoc->getDocumentElement();
  theTopElement->appendChild(theDoc->createTextNode(qtxml::_toDOMS("\n")));
  return true;
}
void SiPixelConfigWriter::write ( std::string &  fname)

Member Data Documentation

xercesc::DOMImplementation* SiPixelConfigWriter::domImpl [private]

Definition at line 54 of file SiPixelConfigWriter.h.

xercesc::DOMWriter* SiPixelConfigWriter::domWriter [private]

Definition at line 55 of file SiPixelConfigWriter.h.

xercesc::DOMElement* SiPixelConfigWriter::lastLayout [private]

Definition at line 51 of file SiPixelConfigWriter.h.

xercesc::DOMElement* SiPixelConfigWriter::lastRow [private]

Definition at line 52 of file SiPixelConfigWriter.h.

xercesc::DOMDocument* SiPixelConfigWriter::theDoc [private]

Definition at line 53 of file SiPixelConfigWriter.h.

xercesc::DOMElement* SiPixelConfigWriter::theTopElement [private]

Definition at line 50 of file SiPixelConfigWriter.h.