|
|
Go to the documentation of this file.
9 #include <xercesc/framework/MemBufInputSource.hpp>
10 #include <xercesc/sax2/XMLReaderFactory.hpp>
11 #include <xercesc/util/XMLUni.hpp>
26 SAX2Parser_->setFeature(XMLUni::fgSAX2CoreValidation,
false);
27 SAX2Parser_->setFeature(XMLUni::fgSAX2CoreNameSpaces,
false);
56 FileNameHolder::const_iterator it =
fileNames_.begin();
58 bool foundFile =
false;
86 pair<std::string, std::string>
pss;
88 pss.second = absoluteFileName;
99 LogDebug(
"DDLParser") <<
"ParseOneFile() Parsing: " <<
fileNames_[fIndex].second << std::endl;
117 char*
dummy(
nullptr);
118 MemBufInputSource mbis(&*ablob.begin(), bsize,
dummy);
124 edm::LogInfo(
"DDLParser") <<
"Start Parsing. Validation is set off for the time being." << std::endl;
126 SAX2Parser_->setFeature(XMLUni::fgSAX2CoreValidation,
false);
127 SAX2Parser_->setFeature(XMLUni::fgSAX2CoreNameSpaces,
false);
130 size_t fileIndex = 0;
131 std::vector<std::string> fullFileName;
132 const std::vector<std::string>& fileList =
dp.getFileList();
133 const std::vector<std::string>& urlList =
dp.getURLList();
135 for (; fileIndex < fileList.size(); ++fileIndex) {
139 if (ts[ts.size() - 1] ==
'/') {
140 fullFileName.emplace_back(ts + tf);
142 fullFileName.emplace_back(ts +
"/" + tf);
145 fullFileName.emplace_back(tf);
149 for (
const auto& fnit : fullFileName) {
153 pair<std::string, std::string>
pss;
192 pair<std::string, std::string> namePair =
fileNames_[
i];
193 LogDebug(
"DDLParser") <<
"Completed parsing file " << namePair.second << std::endl;
214 return (fullname.substr(fullname.rfind(
'/') + 1));
ret
prodAgent to be discontinued
DDLElementRegistry * elementRegistry_
int parse(const DDLDocumentProvider &dp)
Parse all files. Return is meaningless.
XERCES_CPP_NAMESPACE::SAX2XMLReader SAX2XMLReader
bool isParsed(const std::string &filename)
Is the file already parsed?
SAX2XMLReader * SAX2Parser_
SAX2XMLReader is one way of parsing.
std::pair< ALIstring, ALIstring > pss
size_t isFound(const std::string &filename)
Is the file already known by the DDLParser? Returns 0 if not found, and index if found.
std::string currFileName_
Which file is currently being processed.
The main class for processing parsed elements.
Log< level::Info, false > LogInfo
DDLSAX2Handler * errHandler_
~DDLParser()
Destructor terminates the XMLPlatformUtils (as required by Xerces)
DDLSAX2FileHandler is the SAX2 Handler for XML files found in the configuration file.
DDLDocumentProvider provides a set of URLs and filenames.
const std::string getNameSpace(const std::string &fname)
void clearFiles()
Clear the file list - see Warning!
size_t nFiles_
Number of files + 1.
SAX2XMLReader * getXMLParser()
Get the SAX2Parser from the DDLParser. USE WITH CAUTION. Set your own handler, etc.
DDLSAX2Handler inherits from Xerces C++ DefaultHandler.
Compact representation of the geometrical detector hierarchy.
DDLSAX2FileHandler * getDDLSAX2FileHandler()
To get the parent this class allows access to the handler.
const std::string extractFileName(const std::string &fullname)
DDLSAX2ExpressionHandler is the first pass SAX2 Handler for XML files found in the configuration file...
std::map< int, bool > parsed_
Parse status of a given file.
virtual void setNameSpace(const std::string &nms)
DDLSAX2FileHandler * fileHandler_
FileNameHolder fileNames_
List of files to be processed, obtained from the DDLDocumentProvider.
bool parseOneFile(const std::string &filename)
Process a single files.
DDLSAX2ExpressionHandler * expHandler_
void parseFile(const int &numtoproc)
Parse File. Just to hold some common looking code.
void createDDConstants() const
creates all DDConstant from the evaluator which has been already 'filled' in the first scan of the do...