30#include <xercesc/sax2/Attributes.hpp>
31#include <xercesc/sax2/DefaultHandler.hpp>
90 const std::string& file,
const std::string& expectedRoot =
"");
109 void startElement(
const XMLCh*
const uri,
const XMLCh*
const localname,
110 const XMLCh*
const qname,
const XERCES_CPP_NAMESPACE::Attributes& attrs);
122 void characters(
const XMLCh*
const chars,
const XERCES3_SIZE_t length);
137 void endElement(
const XMLCh*
const uri,
const XMLCh*
const localname,
138 const XMLCh*
const qname);
176 void warning(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
187 void error(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
198 void fatalError(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
238 std::string
buildErrorMessage(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
262 const std::string& chars);
284 XMLCh*
convert(
const std::string& name)
const;
317 typedef std::map<std::string, int>
TagMap;
A handler which converts occurring elements and attributes into enums.
void registerParent(const int tag, GenericSAXHandler *handler)
Assigning a parent handler which is enabled when the specified tag is closed.
virtual void myCharacters(int element, const std::string &chars)
Callback method for characters to implement by derived classes.
void needsCharacterData(const bool value=true)
std::string buildErrorMessage(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Builds an error message.
int convertTag(const std::string &tag) const
Converts a tag from its string into its numerical representation.
bool sectionFinished() const
XMLCh * convert(const std::string &name) const
converts from c++-string into unicode
void setSection(const int element, const bool seen)
void startElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname, const XERCES_CPP_NAMESPACE::Attributes &attrs)
The inherited method called when a new tag opens.
std::vector< XMLCh * > AttrMap
bool mySectionEnded
whether the reader has already seen the end of the section
std::string myFileName
The name of the currently parsed file.
GenericSAXHandler(const GenericSAXHandler &s)
invalidated copy constructor
bool mySectionOpen
whether an element of the current section is open
std::pair< int, SUMOSAXAttributes * > retrieveNextSectionStart()
void error(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Handler for XML-errors.
bool mySectionSeen
whether the reader has already seen the begin of the section
GenericSAXHandler * myParentHandler
The handler to give control back to.
int mySection
The tag indicating the current section to parse.
void setFileName(const std::string &name)
Sets the current file name.
std::map< std::string, int > TagMap
int myParentIndicator
The tag indicating that control should be given back.
void characters(const XMLCh *const chars, const XERCES3_SIZE_t length)
The inherited method called when characters occurred.
virtual ~GenericSAXHandler()
Destructor.
virtual void myEndElement(int element)
Callback method for a closing tag to implement by derived classes.
void warning(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Handler for XML-warnings.
std::string myExpectedRoot
The root element to expect, empty string disables the check.
std::pair< int, SUMOSAXAttributes * > myNextSectionStart
void callParentEnd(int element)
signal endElement to the parent handler (special case for MSCalibrator)
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Callback method for an opening tag to implement by derived classes.
std::vector< std::string > myCharactersVector
A list of character strings obtained so far to build the complete characters string at the end.
void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Handler for XML-errors.
bool myRootSeen
whether the reader has already seen the root element
bool myCollectCharacterData
whether the reader should collect character data
const std::string & getFileName() const
returns the current file name
std::vector< std::string > myPredefinedTagsMML
the map from ids to their string representation
const GenericSAXHandler & operator=(const GenericSAXHandler &s)
invalidated assignment operator
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
The inherited method called when a tag is being closed.
Encapsulated SAX-Attributes.
SAX-reader encapsulation containing binary reader.