36 #include <xercesc/sax/HandlerBase.hpp>
37 #include <xercesc/sax/AttributeList.hpp>
38 #include <xercesc/sax/SAXParseException.hpp>
39 #include <xercesc/sax/SAXException.hpp>
54 : myError(false), myOptions(
OptionsCont::getOptions()), myItem() {}
61 XERCES_CPP_NAMESPACE::AttributeList& attributes) {
63 for (
int i = 0; i < (int) attributes.getLength(); i++) {
66 if (key ==
"value" || key ==
"v") {
77 if (value.length() > 0) {
80 WRITE_ERROR(
"Could not set option '" + key +
"' (probably defined twice).");
99 const std::string& value)
const {
113 if (
myValue.find_first_not_of(
"\n\t \a") == std::string::npos) {
126 +
toString(exception.getLineNumber() + 1) +
'/' \
127 +
toString(exception.getColumnNumber()) +
").");
138 +
toString(exception.getLineNumber() + 1) +
'/'
139 +
toString(exception.getColumnNumber()) +
").");
150 +
toString(exception.getLineNumber() + 1) +
'/'
151 +
toString(exception.getColumnNumber()) +
").");
std::string myItem
The name of the currently parsed option.
std::string myValue
The currently read characters string.
void endElement(const XMLCh *const name)
Called on the end of an element.
OptionsCont & myOptions
The options to fill.
void error(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Called on an XML-error.
#define WRITE_WARNING(msg)
bool myError
The information whether an error occured.
static std::string _2str(const E *const data)
void setValue(const std::string &key, std::string &value)
Tries to set the named option to the given value.
virtual void startElement(const XMLCh *const name, XERCES_CPP_NAMESPACE::AttributeList &attributes)
Called on the occurence of the beginning of a tag.
void fatalError(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Called on an XML-fatal error.
bool errorOccured() const
Returns the information whether an error occured.
bool isWriteable(const std::string &name)
Returns the information whether the named option may be set.
OptionsLoader()
Constructor.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
bool setSecure(const std::string &name, const std::string &value) const
Tries to set the named option to the given value.
void warning(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Called on an XML-warning.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
void characters(const XMLCh *const chars, const XERCES3_SIZE_t length)
Called on the occurence of character data.
A storage for options typed value containers)