CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
DQMParserBase Class Reference

#include <DQMParserBase.h>

Inheritance diagram for DQMParserBase:
QTestConfigurationParser SiPixelConfigParser SiPixelLayoutParser SiStripConfigParser SiStripLayoutParser SummaryPlotXmlParser

Public Member Functions

int countNodes (std::string tagName)
 Returns the number of nodes with given name. More...
 
xercesc::DOMDocument * doc ()
 DOM Document. More...
 
 DQMParserBase ()
 Creator. More...
 
void getDocument (std::string configFile, bool UseDB=false)
 Methor that parses the xml file configFile. More...
 
void getNewDocument (std::string configFile, bool UseDB=false)
 Parses a new Document. More...
 
virtual ~DQMParserBase ()
 Destructor. More...
 

Protected Attributes

xercesc::XercesDOMParser * parser
 

Detailed Description

Definition at line 33 of file DQMParserBase.h.

Constructor & Destructor Documentation

DQMParserBase::DQMParserBase ( )

Creator.

Definition at line 18 of file DQMParserBase.cc.

References geometryXMLtoCSV::parser.

18  {
19  parser=0;
20 }
xercesc::XercesDOMParser * parser
Definition: DQMParserBase.h:49
DQMParserBase::~DQMParserBase ( )
virtual

Destructor.

Definition at line 22 of file DQMParserBase.cc.

References geometryXMLtoCSV::parser.

22  {
23  delete parser;
24  parser=0;
25 }
xercesc::XercesDOMParser * parser
Definition: DQMParserBase.h:49

Member Function Documentation

int DQMParserBase::countNodes ( std::string  tagName)

Returns the number of nodes with given name.

Definition at line 62 of file DQMParserBase.cc.

References qtxml::_toDOMS(), and geometryXMLtoCSV::parser.

62  {
63  unsigned int tagsNum =
64  parser->getDocument()->getElementsByTagName(qtxml::_toDOMS(tagName))->getLength();
65  return tagsNum;
66 }
xercesc::XercesDOMParser * parser
Definition: DQMParserBase.h:49
XMLCh * _toDOMS(std::string temp)
xercesc::DOMDocument* DQMParserBase::doc ( )
inline
void DQMParserBase::getDocument ( std::string  configFile,
bool  UseDB = false 
)

Methor that parses the xml file configFile.

Definition at line 28 of file DQMParserBase.cc.

References asciidump::doc, and geometryXMLtoCSV::parser.

Referenced by QTestHandle::configureTests(), SiStripActionExecutor::createShiftReport(), SiPixelActionExecutor::createSummary(), SiPixelInformationExtractor::getTrackerMapHistos(), SiStripSummaryCreator::readConfiguration(), SiStripInformationExtractor::readConfiguration(), and SiPixelActionExecutor::readConfiguration().

28  {
29 
30  parser = new XercesDOMParser;
31  parser->setValidationScheme(XercesDOMParser::Val_Auto);
32  parser->setDoNamespaces(false);
33  if(UseDB){
34 // std::cout<<"=== This is config file from getDocument ====== "<<std::endl;
35 // std::cout<<configFile<<std::endl;
36  MemBufInputSource mb((const XMLByte*)configFile.c_str(),strlen(configFile.c_str()),"",false);
37  parser->parse(mb);
38  }
39  else{
40  parser->parse(configFile.c_str());
41  }
42  xercesc::DOMDocument* doc = parser->getDocument();
43  assert(doc);
44 
45 }
xercesc::XercesDOMParser * parser
Definition: DQMParserBase.h:49
xercesc::DOMDocument * doc()
DOM Document.
Definition: DQMParserBase.h:47
void DQMParserBase::getNewDocument ( std::string  configFile,
bool  UseDB = false 
)

Parses a new Document.

Definition at line 47 of file DQMParserBase.cc.

References gather_cfg::cout, asciidump::doc, and geometryXMLtoCSV::parser.

Referenced by QTestHandle::configureTests().

47  {
48  parser->resetDocumentPool();
49  if(UseDB){
50  std::cout<<"=== This is config file from getNewDocument ==== "<<std::endl;
51  std::cout<<configFile<<std::endl;
52  MemBufInputSource mb((const XMLByte*)configFile.c_str(),strlen(configFile.c_str()),"",false);
53  parser->parse(mb);
54  }
55  else{
56  parser->parse(configFile.c_str());
57  }
58  xercesc::DOMDocument* doc = parser->getDocument();
59  assert(doc);
60 
61 }
xercesc::XercesDOMParser * parser
Definition: DQMParserBase.h:49
tuple cout
Definition: gather_cfg.py:121
xercesc::DOMDocument * doc()
DOM Document.
Definition: DQMParserBase.h:47

Member Data Documentation

xercesc::XercesDOMParser* DQMParserBase::parser
protected

Definition at line 49 of file DQMParserBase.h.

Referenced by doc().