You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
813 B
42 lines
813 B
|
|
#ifndef _CONFIGURATION_H_
|
|
#define _CONFIGURATION_H_
|
|
|
|
#include <string>
|
|
|
|
#define DEFAULT_HTTP_PORT 10080
|
|
#define DEFAULT_HTTPS_PORT 10081
|
|
#define DEFAULT_CONFIG_FILE "/etc/miniwebcam.conf.json"
|
|
|
|
#define CONF_INITFLAGS_PRINT 0x0001
|
|
#define CONF_INITFLAGS_HELP 0x0002
|
|
|
|
class Configuration {
|
|
private:
|
|
int http_port;
|
|
int https_port;
|
|
int runasdaemon;
|
|
std::string filename;
|
|
int initflags;
|
|
|
|
public:
|
|
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
|
|
|