S_New4/parameterManager.h
2019-08-15 14:37:16 +02:00

86 lines
2.0 KiB
C++

#ifndef PARAMETERMANAGER_H
#define PARAMETERMANAGER_H
#include <iostream>
#include <getopt.h>
#include <string.h>
#include <sstream>
#include <sys/stat.h>
#include <limits.h> // PATH_MAX
#include <unistd.h> // readlink()
#ifdef _WIN32
#include <windows.h>
#endif
enum Modus {
EXIT = -1,
DEFAULT_MODUS = 0,
DIRECT_LINK_MODUS = 1,
SEARCH_MODUS = 2,
INFO_MODUS = 3
};
struct Settings {
Settings() {}
Settings(std::string name) : name(name) {}
std::string name,
accountFilePath = "/tmp/a",
accountNumberPath= "/tmp/b",
cookieFilePath = "/tmp/S_New4_cookies",
serienListPath = "/tmp/SerienListe",
proxy_ip = "127.0.0.1",
languages = "GerDub,GerSub,Eng",
genaueHoster = "Vivo,GoUnlimited",
version = "2.1.2",
outputFilePath = "",
default_checkDirPath = "",
default_Searchmuster = "S%Staffel%E%Folge%";
Modus modus = Modus::DEFAULT_MODUS;
bool colorless = false,
debugMode = false,
search_IgnoreUpperLower = true,
search_wantUpdate = false;
int startEpisode = 1,
stopEpisode = 0,
startSeason = 1,
stopSeason = 0,
proxy_port = 9050,
default_maxDirs = 20;
char pathSymbol = '/';
unsigned maxThreads = 4;
};
int manageParameter(Settings &settings, int argc, char ** argv);
std::string getProgramName();
int compare(std::string All_Options_with_komma_between, std::string input);
void setPaths(Settings &settings);
bool dirExists(std::string dir);
std::string getexepath();
void setPathSymbol(Settings &settings);
int unterOption_help();
int unterOption_default(Settings * settings, int argc, char **argv);
void unterOption_default_help();
int unterOption_url(Settings * settings, int argc, char **argv);
void unterOption_url_help();
int unterOption_search(Settings * settings, int argc, char **argv);
void unterOption_search_help();
int unterOption_info(Settings * settings, int argc, char **argv);
void unterOption_info_help();
#endif // PARAMETERMANAGER_H