22 #ifndef GenericSAXHandler_h
23 #define GenericSAXHandler_h
40 #include <xercesc/sax2/Attributes.hpp>
41 #include <xercesc/sax2/DefaultHandler.hpp>
99 const std::string& file);
118 void startElement(
const XMLCh*
const uri,
const XMLCh*
const localname,
119 const XMLCh*
const qname,
const XERCES_CPP_NAMESPACE::Attributes& attrs);
146 void endElement(
const XMLCh*
const uri,
const XMLCh*
const localname,
147 const XMLCh*
const qname);
185 void warning(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
196 void error(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
207 void fatalError(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
225 std::string
buildErrorMessage(
const XERCES_CPP_NAMESPACE::SAXParseException& exception);
249 const std::string& chars);
269 XMLCh*
convert(
const std::string& name)
const;
302 typedef std::map<std::string, int>
TagMap;
GenericSAXHandler(StringBijection< int >::Entry *tags, int terminatorTag, StringBijection< int >::Entry *attrs, int terminatorAttr, const std::string &file)
Constructor.
std::string myFileName
The name of the currently parsed file.
std::string buildErrorMessage(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Builds an error message.
SAX-reader encapsulation containing binary reader.
std::vector< std::string > myCharactersVector
A list of character strings obtained so far to build the complete characters string at the end...
void error(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Handler for XML-errors.
XMLCh * convert(const std::string &name) const
converts from c++-string into unicode
int convertTag(const std::string &tag) const
Converts a tag from its string into its numerical representation.
void characters(const XMLCh *const chars, const XERCES3_SIZE_t length)
The inherited method called when characters occured.
virtual ~GenericSAXHandler()
Destructor.
A handler which converts occuring elements and attributes into enums.
const GenericSAXHandler & operator=(const GenericSAXHandler &s)
invalidated assignment operator
const std::string & getFileName() const
returns the current file name
void setFileName(const std::string &name)
Sets the current file name.
Encapsulated SAX-Attributes.
void warning(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Handler for XML-warnings.
virtual void myCharacters(int element, const std::string &chars)
Callback method for characters to implement by derived classes.
std::map< int, XMLCh * > AttrMap
GenericSAXHandler * myParentHandler
The handler to give control back to.
void registerParent(const int tag, GenericSAXHandler *handler)
Assigning a parent handler which is enabled when the specified tag is closed.
void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Handler for XML-errors.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Callback method for an opening tag to implement by derived classes.
std::map< std::string, int > TagMap
std::map< int, std::string > myPredefinedTagsMML
the map from ids to their string representation
int myParentIndicator
The tag indicating that control should be given back.
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.
void endElement(const XMLCh *const uri, const XMLCh *const localname, const XMLCh *const qname)
The inherited method called when a tag is being closed.
virtual void myEndElement(int element)
Callback method for a closing tag to implement by derived classes.