#ifndef _CONFIGURATION_H_ #define _CONFIGURATION_H_ #include #include #include "config.h" #define DEFAULT_HTTP_PORT 8080 #define DEFAULT_HTTPS_PORT 8081 #define DEFAULT_CONFIG_FILE "/etc/miniwebcam/miniwebcam.conf" #define DEFAULT_SSL_KEY "/etc/miniwebcam/ssl-key.pem" #define DEFAULT_SSL_CERT "/etc/miniwebcam/ssl-cert.pem" #define DEFAULT_VDEV_IOMODE 1 #define DEFAULT_VDEV_DEVICE "/dev/video0" #define DEFAULT_VDEV_HEIGHT -1 #define DEFAULT_VDEV_WIDTH -1 #define DEFAULT_WEB_WIDTH 1024 #define DEFAULT_WEB_HEIGHT 768 #define CONF_INITFLAGS_PRINT 0x0001 #define CONF_INITFLAGS_HELP 0x0002 class Configuration { private: public: int http_port; int https_port; std::string ssl_key; std::string ssl_cert; int runasdaemon; std::string filename; int initflags; int web_height; int web_width; int web_imagerefresh; int vdev_height; int vdev_width; int vdev_iomode; std::string vdev_device; std::string vdev_format; std::string vdev_dumpfile; std::string vdev_dumppath; Configuration(); ~Configuration(); int LoadArgs(int argc, char **argv); int LoadFile(std::string fn); int GetInitFlags() { return initflags; }; std::string GetFilename() { return filename; }; int PrintConfig(); // print current configuration void Help(); // print Help }; extern Configuration config; #endif