27#include <xercesc/framework/XMLPScanToken.hpp>
28#include <xercesc/parsers/SAXParser.hpp>
29#include <xercesc/sax/HandlerBase.hpp>
30#include <xercesc/sax/AttributeList.hpp>
31#include <xercesc/sax/SAXParseException.hpp>
32#include <xercesc/sax/SAXException.hpp>
33#include <xercesc/util/PlatformUtils.hpp>
60 for (
int i = 0; i < argc; i++) {
79 if (!commandLineOnly) {
100 if (oc.
exists(
"configuration-file") && oc.
isSet(
"configuration-file")) {
101 const std::string path = oc.
getString(
"configuration-file");
105 const bool verbose = !oc.
exists(
"verbose") || oc.
getBool(
"verbose");
111 XERCES_CPP_NAMESPACE::SAXParser parser;
112 parser.setValidationScheme(XERCES_CPP_NAMESPACE::SAXParser::Val_Never);
113 parser.setDisableDefaultEntityResolution(
true);
117 parser.setDocumentHandler(&handler);
118 parser.setErrorHandler(&handler);
123 }
catch (
const XERCES_CPP_NAMESPACE::XMLException& e) {
144 XERCES_CPP_NAMESPACE::SAXParser parser;
145 parser.setValidationScheme(XERCES_CPP_NAMESPACE::SAXParser::Val_Never);
146 parser.setDisableDefaultEntityResolution(
true);
150 parser.setDocumentHandler(&handler);
151 parser.setErrorHandler(&handler);
152 XERCES_CPP_NAMESPACE::XMLPScanToken token;
159 const bool result = parser.parseFirst(inputStream, token);
166 while (parser.parseNext(token) && handler.
getItem() ==
"");
170 }
catch (
const XERCES_CPP_NAMESPACE::XMLException& e) {
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
static bool isReadable(std::string path)
Checks whether the given file is readable.
static bool isDirectory(std::string path)
Checks whether the given file is a directory.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool exists(const std::string &name) const
Returns the information whether the named option is known.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
void relocateFiles(const std::string &configuration) const
Modifies file name options according to the configuration path.
static void loadConfiguration()
Loads and parses the configuration.
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
static std::vector< std::string > myArgs
static std::string getRoot(const std::string &filename)
Retrieves the XML root element of a supposed configuration or net.
static std::chrono::time_point< std::chrono::system_clock > myLoadTime
A SAX-Handler for loading options.
const std::string & getItem() const
Returns the last item read.
bool errorOccurred() const
Returns the information whether an error occurred.
static bool parse(const std::vector< std::string > &args, const bool ignoreAppenders=false)
Parses the given command line arguments.
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
static std::string transcodeToLocal(const std::string &utf8String)
convert a string from UTF-8 to the local codepage
static std::string transcodeFromLocal(const std::string &localString)
convert a string from the local codepage to UTF-8