summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Interpreter.h
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-07 23:13:54 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-07 23:13:54 (GMT)
commit36b5c7614cc896d043ddeebae1cdb4e8e94afe18 (patch)
treee14ac52189363b252aa8ea10fdd66efef069d665 /src/uscxml/Interpreter.h
parent567df9318fff6d1bb570191c33ea68cd6ef88bee (diff)
downloaduscxml-36b5c7614cc896d043ddeebae1cdb4e8e94afe18.zip
uscxml-36b5c7614cc896d043ddeebae1cdb4e8e94afe18.tar.gz
uscxml-36b5c7614cc896d043ddeebae1cdb4e8e94afe18.tar.bz2
Reduced compile times
- new commandline argument handling - compiles on windows again
Diffstat (limited to 'src/uscxml/Interpreter.h')
-rw-r--r--src/uscxml/Interpreter.h47
1 files changed, 44 insertions, 3 deletions
diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h
index aadef72..b8093ab 100644
--- a/src/uscxml/Interpreter.h
+++ b/src/uscxml/Interpreter.h
@@ -1,7 +1,10 @@
#ifndef RUNTIME_H_SQ1MBKGN
#define RUNTIME_H_SQ1MBKGN
+// this has to be the first include or MSVC will run amok
#include "uscxml/Common.h"
+#include "getopt.h"
+
#include "uscxml/URL.h"
#include <boost/algorithm/string.hpp>
@@ -61,6 +64,44 @@ enum Capabilities {
CAN_GENERIC_HTTP = 2,
};
+class InterpreterOptions {
+public:
+ bool useDot;
+ bool verbose;
+ bool withHTTP;
+ bool withHTTPS;
+ int logLevel;
+ unsigned short httpPort;
+ unsigned short httpsPort;
+ std::string pluginPath;
+ std::string certificate;
+ std::string privateKey;
+ std::string publicKey;
+ std::map<std::string, InterpreterOptions*> interpreters;
+ std::map<std::string, std::string> additionalParameters;
+
+ std::string error;
+
+ operator bool() {
+ return error.length() == 0;
+ }
+
+ static void printUsageAndExit(const char* progName);
+ static InterpreterOptions fromCmdLine(int argc, char** argv);
+ unsigned int getCapabilities();
+
+protected:
+ InterpreterOptions() :
+ useDot(false),
+ verbose(false),
+ withHTTP(true),
+ withHTTPS(true),
+ logLevel(0),
+ httpPort(8080),
+ httpsPort(8443)
+ {}
+};
+
class InterpreterImpl : public boost::enable_shared_from_this<InterpreterImpl> {
public:
@@ -100,7 +141,7 @@ public:
return _baseURI;
}
- void setCmdLineOptions(int argc, char** argv);
+ void setCmdLineOptions(std::map<std::string, std::string> params);
Data getCmdLineOptions() {
return _cmdLineOptions;
}
@@ -400,8 +441,8 @@ public:
return _impl->getNameSpaceInfo();
}
- void setCmdLineOptions(int argc, char** argv) {
- return _impl->setCmdLineOptions(argc, argv);
+ void setCmdLineOptions(std::map<std::string, std::string> params) {
+ return _impl->setCmdLineOptions(params);
}
Data getCmdLineOptions() {
return _impl->getCmdLineOptions();