CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
DDLSAX2ConfigHandler Class Reference

DDLSAX2ConfigHandler is the handler for the configuration file. More...

#include <DDLSAX2ConfigHandler.h>

Inheritance diagram for DDLSAX2ConfigHandler:
DDLSAX2Handler

Public Member Functions

 DDLSAX2ConfigHandler (DDCompactView &cpv)
 
const bool doValidation () const
 
const std::vector< std::string > & getFileNames () const
 
const std::string getSchemaLocation () const
 
const std::vector< std::string > & getURLs () const
 
void startElement (const XMLCh *uri, const XMLCh *localname, const XMLCh *qname, const Attributes &attrs) override
 
 ~DDLSAX2ConfigHandler () override
 
- Public Member Functions inherited from DDLSAX2Handler
void characters (const XMLCh *chars, XMLSize_t length) override
 
void comment (const XMLCh *chars, XMLSize_t length) override
 
 DDLSAX2Handler ()
 
virtual void dumpStats (const std::string &fname)
 
void endElement (const XMLCh *uri, const XMLCh *localname, const XMLCh *qname) override
 
void error (const SAXParseException &exception) override
 
void fatalError (const SAXParseException &exception) override
 
unsigned int getAttrCount () const
 Get the count of attributes processed so far. More...
 
unsigned int getCharacterCount () const
 Get the count of characters processed so far. More...
 
unsigned int getElementCount () const
 Get the count of elements processed so far. More...
 
bool getSawErrors () const
 Did the XML parser see any errors? More...
 
unsigned int getSpaceCount () const
 Get the count of spaces processed so far. More...
 
void ignorableWhitespace (const XMLCh *chars, XMLSize_t length) override
 
void resetDocument () override
 
virtual void setNameSpace (const std::string &nms)
 
virtual void setUserNS (bool userns)
 
void startElement (const XMLCh *uri, const XMLCh *localname, const XMLCh *qname, const Attributes &attrs) override
 
void warning (const SAXParseException &exception) override
 
 ~DDLSAX2Handler () override
 

Private Attributes

DDCompactViewcpv_
 
bool doValidation_
 
std::vector< std::string > files_
 
std::string schemaLocation_
 
std::vector< std::string > urls_
 

Additional Inherited Members

- Public Types inherited from DDLSAX2Handler
using Attributes = XERCES_CPP_NAMESPACE::Attributes
 
using SAXParseException = XERCES_CPP_NAMESPACE::SAXParseException
 
- Protected Attributes inherited from DDLSAX2Handler
XMLSize_t attrCount_
 
XMLSize_t characterCount_
 
XMLSize_t elementCount_
 
std::string nmspace_
 
bool sawErrors_
 
XMLSize_t spaceCount_
 
bool userNS_
 

Detailed Description

DDLSAX2ConfigHandler is the handler for the configuration file.

Author
Michael Case

DDLSAX2ConfigHandler.h - description

begin: Mon Oct 22 2001 email: case@.nosp@m.ucdh.nosp@m.ep.uc.nosp@m.davi.nosp@m.s.edu

This handler is used by the DDLParser to process configuration files.

Definition at line 23 of file DDLSAX2ConfigHandler.h.

Constructor & Destructor Documentation

◆ DDLSAX2ConfigHandler()

DDLSAX2ConfigHandler::DDLSAX2ConfigHandler ( DDCompactView cpv)

Definition at line 15 of file DDLSAX2ConfigHandler.cc.

16  : doValidation_(false), files_(), urls_(), schemaLocation_(), cpv_(cpv) {}

◆ ~DDLSAX2ConfigHandler()

DDLSAX2ConfigHandler::~DDLSAX2ConfigHandler ( void  )
override

Definition at line 18 of file DDLSAX2ConfigHandler.cc.

18 {}

Member Function Documentation

◆ doValidation()

const bool DDLSAX2ConfigHandler::doValidation ( void  ) const

Definition at line 62 of file DDLSAX2ConfigHandler.cc.

62 { return doValidation_; }

References doValidation_.

Referenced by FIPConfiguration::doValidation().

◆ getFileNames()

const std::vector< std::string > & DDLSAX2ConfigHandler::getFileNames ( void  ) const

Definition at line 56 of file DDLSAX2ConfigHandler.cc.

56 { return files_; }

References files_.

Referenced by FIPConfiguration::readConfig().

◆ getSchemaLocation()

const std::string DDLSAX2ConfigHandler::getSchemaLocation ( void  ) const

Definition at line 60 of file DDLSAX2ConfigHandler.cc.

60 { return schemaLocation_; }

References schemaLocation_.

Referenced by FIPConfiguration::getSchemaLocation().

◆ getURLs()

const std::vector< std::string > & DDLSAX2ConfigHandler::getURLs ( void  ) const

Definition at line 58 of file DDLSAX2ConfigHandler.cc.

58 { return urls_; }

References urls_.

Referenced by FIPConfiguration::readConfig().

◆ startElement()

void DDLSAX2ConfigHandler::startElement ( const XMLCh *  uri,
const XMLCh *  localname,
const XMLCh *  qname,
const Attributes attrs 
)
override

Definition at line 32 of file DDLSAX2ConfigHandler.cc.

35  {
36  if (XMLString::equals(qname, uStr("File").ptr())) {
37  std::string name = toString(attrs.getValue(uStr("name").ptr()));
38  std::string url = toString(attrs.getValue(uStr("url").ptr()));
39 
40  files_.emplace_back(name);
41  urls_.emplace_back(url);
42  } else if (XMLString::equals(qname, uStr("Root").ptr())) {
43  std::string fileName = toString(attrs.getValue(uStr("fileName").ptr()));
44  std::string logicalPartName = toString(attrs.getValue(uStr("logicalPartName").ptr()));
45 
46  fileName = fileName.substr(0, fileName.find('.'));
47  DDLogicalPart root(DDName(logicalPartName, fileName));
49  cpv_.setRoot(root);
50  } else if (XMLString::equals(qname, uStr("Schema").ptr())) {
51  schemaLocation_ = toString(attrs.getValue(uStr("schemaLocation").ptr()));
52  doValidation_ = XMLString::equals(attrs.getValue(uStr("validation").ptr()), uStr("true").ptr());
53  }
54 }

References cpv_, doValidation_, equals(), MillePedeFileConverter_cfg::fileName, files_, DDI::Singleton< I >::instance(), Skims_PA_cff::name, schemaLocation_, DDCompactView::setRoot(), AlCaHLTBitMon_QueryRunRegistry::string, toolbox::toString(), relmon_authenticated_wget::url, urls_, and cms::xerces::uStr().

Member Data Documentation

◆ cpv_

DDCompactView& DDLSAX2ConfigHandler::cpv_
private

Definition at line 43 of file DDLSAX2ConfigHandler.h.

Referenced by startElement().

◆ doValidation_

bool DDLSAX2ConfigHandler::doValidation_
private

Definition at line 39 of file DDLSAX2ConfigHandler.h.

Referenced by doValidation(), and startElement().

◆ files_

std::vector<std::string> DDLSAX2ConfigHandler::files_
private

Definition at line 40 of file DDLSAX2ConfigHandler.h.

Referenced by getFileNames(), and startElement().

◆ schemaLocation_

std::string DDLSAX2ConfigHandler::schemaLocation_
private

Definition at line 42 of file DDLSAX2ConfigHandler.h.

Referenced by getSchemaLocation(), and startElement().

◆ urls_

std::vector<std::string> DDLSAX2ConfigHandler::urls_
private

Definition at line 41 of file DDLSAX2ConfigHandler.h.

Referenced by getURLs(), and startElement().

relmon_authenticated_wget.url
url
Definition: relmon_authenticated_wget.py:22
DDName
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
DDLSAX2ConfigHandler::urls_
std::vector< std::string > urls_
Definition: DDLSAX2ConfigHandler.h:41
DDCompactView::setRoot
void setRoot(const DDLogicalPart &root)
Definition: DDCompactView.cc:96
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
DDLSAX2ConfigHandler::cpv_
DDCompactView & cpv_
Definition: DDLSAX2ConfigHandler.h:43
DDLSAX2ConfigHandler::schemaLocation_
std::string schemaLocation_
Definition: DDLSAX2ConfigHandler.h:42
toolbox::toString
std::string toString(const char *format,...)
Definition: xdaq_compat.cc:4
equals
bool equals(const edm::RefToBase< Jet > &j1, const edm::RefToBase< Jet > &j2)
Definition: DeepCMVATagInfoProducer.cc:56
DDI::Singleton::instance
static value_type & instance()
DDLogicalPart
A DDLogicalPart aggregates information concerning material, solid and sensitveness ....
Definition: DDLogicalPart.h:93
root
Definition: RooFitFunction.h:10
cms::xerces::uStr
ZStr< XMLCh > uStr(char const *str)
Definition: XercesStrUtils.h:31
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDLSAX2ConfigHandler::doValidation_
bool doValidation_
Definition: DDLSAX2ConfigHandler.h:39
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
DDLSAX2ConfigHandler::files_
std::vector< std::string > files_
Definition: DDLSAX2ConfigHandler.h:40