27#include <xercesc/sax/HandlerBase.hpp>
28#include <xercesc/sax/AttributeList.hpp>
29#include <xercesc/sax/SAXParseException.hpp>
30#include <xercesc/sax/SAXException.hpp>
48 myOptions(customOptions),
59 for (
int i = 0; i < (int)attributes.getLength(); i++) {
62 if (key ==
"value" || key ==
"v") {
73 if (value.length() > 0) {
77 WRITE_ERRORF(
TL(
"Could not set option '%' (probably defined twice)."), key);
96 options.
set(name, value);
108 if (
myValue.find_first_not_of(
"\n\t \a") == std::string::npos) {
121 +
toString(exception.getLineNumber() + 1) +
'/' \
122 +
toString(exception.getColumnNumber()) +
").");
131 +
toString(exception.getLineNumber() + 1) +
'/'
132 +
toString(exception.getColumnNumber()) +
").");
141 +
toString(exception.getLineNumber() + 1) +
'/'
142 +
toString(exception.getColumnNumber()) +
").");
#define WRITE_ERRORF(...)
#define WRITE_WARNING(msg)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A storage for options typed value containers)
bool isWriteable(const std::string &name)
Returns the information whether the named option may be set.
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
~OptionsLoader()
destructor
OptionsLoader(OptionsCont &customOptions, const bool routeOnly=false)
Constructor for default option container.
virtual void startElement(const XMLCh *const name, XERCES_CPP_NAMESPACE::AttributeList &attributes)
Called on the occurrence of the beginning of a tag.
void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Called on an XML-fatal error.
bool myError
The information whether an error occurred.
void characters(const XMLCh *const chars, const XERCES3_SIZE_t length)
Called on the occurrence of character data.
bool errorOccurred() const
Returns the information whether an error occurred.
void warning(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Called on an XML-warning.
std::string myValue
The currently read characters string.
bool setSecure(OptionsCont &options, const std::string &name, const std::string &value) const
Tries to set the named option to the given value.
void endElement(const XMLCh *const name)
Called on the end of an element.
OptionsCont & myOptions
The options to fill.
std::string myItem
The name of the currently parsed option.
void setValue(const std::string &key, const std::string &value)
Tries to set the named option to the given value.
const bool myRootOnly
The information whether only the root element should be parsed.
void error(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Called on an XML-error.
static std::string transcode(const XMLCh *const data)
converts a 0-terminated XMLCh* array (usually UTF-16, stemming from Xerces) into std::string in UTF-8