1 #include "xercesc/sax2/SAX2XMLReader.hpp"
2 #include <xercesc/sax2/XMLReaderFactory.hpp>
3 #include "xercesc/sax2/DefaultHandler.hpp"
4 #include "xercesc/sax2/Attributes.hpp"
6 #include <xercesc/framework/MemBufInputSource.hpp>
7 XERCES_CPP_NAMESPACE_USE
67 virtual void startElement (
const XMLCh *
const uri,
const XMLCh *
const localname,
const XMLCh *
const qname,
const Attributes &attrs)
override;
68 virtual void endElement (
const XMLCh *
const uri,
const XMLCh *
const localname,
const XMLCh *
const qname)
override;
69 virtual void characters(
const XMLCh*
const chars,
const unsigned int length)
override;
73 if (val==0)
return false;
91 if (!XMLString::compareIString(localname,
xc_Parameter)) {
99 }
else if (!XMLString::compareIString(localname,
xc_Data)) {
123 if (entry.empty())
continue;
139 while (offset<length) {
141 for (i=0; i<length-offset && i<255; i++)
m_workx[i]=chars[i+offset];
156 m_parser->
parser=std::auto_ptr<xercesc::SAX2XMLReader>(xercesc::XMLReaderFactory::createXMLReader());
159 MemBufInputSource
src((
const unsigned char*)xmlDocument.c_str(), xmlDocument.length(),
"hcal::PatternReader");
168 std::vector<std::string> items;
171 this->
parse(xmlDocument,parameters,items,encoding);
173 if (encoding==
"dec") formatting=10;
174 if (encoding==
"hex") formatting=16;
177 for (std::vector<std::string>::const_iterator
i=items.begin();
i!=items.end();
i++)
178 data.push_back(strtol(
i->c_str(),0,formatting));
void parse(const std::string &xmlDocument, std::map< std::string, std::string > ¶meters, std::vector< std::string > &items, std::string &encoding)
bool cvt2String(const XMLCh *val, std::string &ou)
std::vector< std::string > & m_items
std::auto_ptr< SAX2XMLReader > parser
std::string & m_dataEncoding
ConfigurationDBHandler(std::map< std::string, std::string > ¶meters, std::vector< std::string > &items, std::string &encoding)
virtual void ignorableWhitespace(const XMLCh *chars, const unsigned int length) override
enum ConfigurationDBHandler::@66 m_mode
XMLCh * transcode(const T &fInput)
std::map< std::string, std::string > & m_parameters
std::list< ConfigurationDatabaseStandardXMLParser::Item > & m_items
virtual ~ConfigurationDBHandler()
virtual void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const Attributes &attrs) override
char data[epos_bytes_allocation]
HcalPatternXMLParserImpl * m_parser
virtual void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname) override
virtual void characters(const XMLCh *const chars, const unsigned int length) override