diff options
author | Stefan Radomski <github@mintwerk.de> | 2016-06-23 11:06:59 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2016-06-23 11:06:59 (GMT) |
commit | 64298f234d4751d094ef91833830337417404e82 (patch) | |
tree | 93a2ec8a1674353a6125787267699d326967bc4f /contrib/src/uscxml/InterpreterOptions.h | |
parent | 0e0be07906a720ae54e4572d6ac0cb657424550d (diff) | |
download | uscxml-64298f234d4751d094ef91833830337417404e82.zip uscxml-64298f234d4751d094ef91833830337417404e82.tar.gz uscxml-64298f234d4751d094ef91833830337417404e82.tar.bz2 |
Smaller bug-fixes and refactorings
Diffstat (limited to 'contrib/src/uscxml/InterpreterOptions.h')
-rw-r--r-- | contrib/src/uscxml/InterpreterOptions.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/contrib/src/uscxml/InterpreterOptions.h b/contrib/src/uscxml/InterpreterOptions.h new file mode 100644 index 0000000..44bb399 --- /dev/null +++ b/contrib/src/uscxml/InterpreterOptions.h @@ -0,0 +1,81 @@ +/** + * @file + * @author 2016 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de) + * @copyright Simplified BSD + * + * @cond + * This program is free software: you can redistribute it and/or modify + * it under the terms of the FreeBSD license as published by the FreeBSD + * project. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the FreeBSD license along with this + * program. If not, see <http://www.opensource.org/licenses/bsd-license>. + * @endcond + */ + +#ifndef INTERPRETEROPTIONS_H_9D94370D +#define INTERPRETEROPTIONS_H_9D94370D + +#include "uscxml/config.h" +#include "uscxml/Common.h" + +#include <string> +#include <map> +#include <vector> + +namespace uscxml { + +/** + * @ingroup interpreter + * Options to pass into an interpreter. + */ +class USCXML_API InterpreterOptions { +public: + InterpreterOptions() : + verbose(false), + validate(false), + withHTTP(true), + withHTTPS(true), + withWS(true), + withDebugger(true), + logLevel(0), + httpPort(5080), + httpsPort(5443), + wsPort(5081) { + } + + bool verbose; + bool validate; + bool withHTTP; + bool withHTTPS; + bool withWS; + bool withDebugger; + int logLevel; + unsigned short httpPort; + unsigned short httpsPort; + unsigned short wsPort; + std::string pluginPath; + std::string certificate; + std::string privateKey; + std::string publicKey; + std::vector<std::pair<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); + +}; + +} + +#endif /* end of include guard: INTERPRETEROPTIONS_H_9D94370D */ |