2019-08-03 16:23:12 +00:00
|
|
|
#ifndef PARAMETERMANAGER_H
|
|
|
|
#define PARAMETERMANAGER_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <getopt.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sstream>
|
2019-08-03 16:27:05 +00:00
|
|
|
#include <sys/stat.h>
|
2019-08-03 16:23:12 +00:00
|
|
|
|
|
|
|
enum Modus {
|
|
|
|
EXIT = -1,
|
|
|
|
DEFAULT_MODUS = 0,
|
2019-08-03 16:27:05 +00:00
|
|
|
DIRECT_LINK_MODUS = 1,
|
2019-08-11 14:52:23 +00:00
|
|
|
Search_MODUS = 2,
|
|
|
|
|
2019-08-03 16:23:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct Settings {
|
|
|
|
Settings() {}
|
|
|
|
Settings(std::string name) : name(name) {}
|
|
|
|
|
|
|
|
std::string name,
|
|
|
|
accountFilePath = "/tmp/a",
|
|
|
|
accountNumberPath= "/tmp/b",
|
|
|
|
cookieFilePath = "/tmp/S_New4_cookies",
|
2019-08-03 16:27:05 +00:00
|
|
|
serienListPath = "/tmp/SerienListe",
|
2019-08-03 16:23:12 +00:00
|
|
|
proxy_ip = "127.0.0.1",
|
|
|
|
languages = "GerDub,GerSub,Eng",
|
2019-08-03 16:27:05 +00:00
|
|
|
genaueHoster = "",
|
2019-08-11 14:52:23 +00:00
|
|
|
version = "2.0.0",
|
|
|
|
outputFilePath = "",
|
|
|
|
default_checkDirPath = "",
|
|
|
|
default_Searchmuster = "S%Staffel%E%Folge%";
|
|
|
|
|
2019-08-03 16:23:12 +00:00
|
|
|
Modus modus = Modus::DEFAULT_MODUS;
|
|
|
|
bool colorless = false,
|
2019-08-03 16:27:05 +00:00
|
|
|
debugMode = false,
|
|
|
|
search_IgnoreUpperLower = true,
|
|
|
|
search_wantUpdate = false;
|
2019-08-03 16:23:12 +00:00
|
|
|
int startEpisode = 1,
|
|
|
|
stopEpisode = 0,
|
|
|
|
startSeason = 1,
|
2019-08-03 16:27:05 +00:00
|
|
|
stopSeason = 0,
|
2019-08-11 14:52:23 +00:00
|
|
|
proxy_port = 9050,
|
|
|
|
default_maxDirs = 20;
|
|
|
|
const char pathSymbol = '/';
|
2019-08-03 16:23:12 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2019-08-03 16:27:05 +00:00
|
|
|
int manageParameter(Settings &settings, int argc, char ** argv);
|
2019-08-03 16:23:12 +00:00
|
|
|
std::string getProgramName(char * argv0);
|
|
|
|
int compare(std::string All_Options_with_komma_between, std::string input);
|
2019-08-03 16:27:05 +00:00
|
|
|
void setPaths(Settings &settings, std::string executablePathTo);
|
|
|
|
bool dirExists(std::string dir);
|
2019-08-03 16:23:12 +00:00
|
|
|
|
2019-08-03 16:27:05 +00:00
|
|
|
int unterOption_help(Settings * settings, char *argv0);
|
2019-08-03 16:23:12 +00:00
|
|
|
|
2019-08-03 16:27:05 +00:00
|
|
|
int unterOption_default(Settings * settings, int argc, char **argv);
|
2019-08-03 16:23:12 +00:00
|
|
|
void unterOption_default_help(Settings * settings, char * argv0);
|
|
|
|
|
2019-08-03 16:27:05 +00:00
|
|
|
int unterOption_url(Settings * settings, int argc, char **argv);
|
2019-08-03 16:23:12 +00:00
|
|
|
void unterOption_url_help(Settings * settings, char *argv0);
|
|
|
|
|
2019-08-03 16:27:05 +00:00
|
|
|
int unterOption_search(Settings * settings, int argc, char **argv);
|
|
|
|
void unterOption_search_help(Settings * settings, char *argv0);
|
|
|
|
|
|
|
|
|
2019-08-03 16:23:12 +00:00
|
|
|
|
|
|
|
#endif // PARAMETERMANAGER_H
|