Eclipse SUMO - Simulation of Urban MObility
|
A SAX-Handler for loading options. More...
#include <TemplateHandler.h>
Static Public Member Functions | |
static void | parseTemplate (OptionsCont &options, const std::string &templateString) |
run parser | |
Private Member Functions | |
TemplateHandler & | operator= (const TemplateHandler &s)=delete |
invalid assignment operator | |
TemplateHandler (const TemplateHandler &s)=delete | |
invalid copy constructor | |
TemplateHandler (OptionsCont &options) | |
Constructor. | |
~TemplateHandler () | |
destructor | |
Handlers for the SAX DocumentHandler interface | |
void | startElement (const XMLCh *const name, XERCES_CPP_NAMESPACE::AttributeList &attributes) |
Called on the occurrence of the beginning of a tag. | |
bool | addOption (std::string value, const std::string &synonymes, const std::string &type, const std::string &help, bool required, bool positional, const std::string &listSep) const |
add option | |
void | endElement (const XMLCh *const name) |
Called on the end of an element. | |
Handlers for the SAX ErrorHandler interface | |
void | warning (const XERCES_CPP_NAMESPACE::SAXParseException &exception) |
Called on an XML-warning. | |
void | error (const XERCES_CPP_NAMESPACE::SAXParseException &exception) |
Called on an XML-error. | |
void | fatalError (const XERCES_CPP_NAMESPACE::SAXParseException &exception) |
Called on an XML-fatal error. | |
Private Attributes | |
bool | myError |
The information whether an error occurred. | |
int | myLevel |
The nesting level of parsed elements. | |
std::string | myOptionName |
The name of the current option. | |
OptionsCont & | myOptions |
The options to fill. | |
std::string | mySubTopic |
current subtopic | |
Static Private Attributes | |
static const std::string | INVALID_DOUBLE_STR = toString(INVALID_DOUBLE) |
invalid double in string format | |
static const std::string | INVALID_INT_STR = toString(INVALID_INT) |
invalid int in string format | |
A SAX-Handler for loading options.
Definition at line 43 of file TemplateHandler.h.
|
private |
Constructor.
Definition at line 76 of file TemplateHandler.cpp.
|
private |
destructor
Definition at line 82 of file TemplateHandler.cpp.
|
privatedelete |
invalid copy constructor
|
private |
add option
Definition at line 141 of file TemplateHandler.cpp.
References OptionsCont::addDescription(), OptionsCont::addSynonyme(), OptionsCont::doRegister(), OptionsCont::exists(), INVALID_DOUBLE_STR, INVALID_INT_STR, Option::isSet(), myOptionName, myOptions, mySubTopic, Option::set(), OptionsCont::setFurtherAttributes(), and WRITE_WARNING.
Referenced by startElement().
|
private |
Called on the end of an element.
Resets the element name
Definition at line 229 of file TemplateHandler.cpp.
References myLevel, and myOptionName.
|
private |
Called on an XML-error.
The warning is reported to the error-instance of MsgHandler
Definition at line 249 of file TemplateHandler.cpp.
References myError, toString(), StringUtils::transcode(), and WRITE_ERROR.
|
private |
Called on an XML-fatal error.
The warning is reported to the error-instance of MsgHandler
Definition at line 259 of file TemplateHandler.cpp.
References myError, toString(), StringUtils::transcode(), and WRITE_ERROR.
|
privatedelete |
invalid assignment operator
|
static |
run parser
Definition at line 52 of file TemplateHandler.cpp.
References myError, OptionsCont::resetDefault(), TLF, and StringUtils::transcode().
Referenced by GNEApplicationWindow::GNEApplicationWindow(), and GNEPythonTool::GNEPythonTool().
|
private |
Called on the occurrence of the beginning of a tag.
Sets the name of the last item
Definition at line 86 of file TemplateHandler.cpp.
References addOption(), OptionsCont::addOptionSubTopic(), OptionsCont::getSubTopics(), myLevel, myOptionName, myOptions, mySubTopic, StringUtils::toBool(), and StringUtils::transcode().
|
private |
Called on an XML-warning.
The warning is reported to the warning-instance of MsgHandler
Definition at line 239 of file TemplateHandler.cpp.
References myError, toString(), StringUtils::transcode(), and WRITE_WARNING.
|
staticprivate |
invalid double in string format
Definition at line 119 of file TemplateHandler.h.
Referenced by addOption().
|
staticprivate |
invalid int in string format
Definition at line 116 of file TemplateHandler.h.
Referenced by addOption().
|
private |
The information whether an error occurred.
Definition at line 101 of file TemplateHandler.h.
Referenced by error(), fatalError(), parseTemplate(), and warning().
|
private |
The nesting level of parsed elements.
Definition at line 104 of file TemplateHandler.h.
Referenced by endElement(), and startElement().
|
private |
The name of the current option.
Definition at line 110 of file TemplateHandler.h.
Referenced by addOption(), endElement(), and startElement().
|
private |
The options to fill.
Definition at line 107 of file TemplateHandler.h.
Referenced by addOption(), and startElement().
|
private |
current subtopic
Definition at line 113 of file TemplateHandler.h.
Referenced by addOption(), and startElement().