2019-07-06 18:47:29 +00:00
|
|
|
#ifndef MANAGEPROGRAM_H
|
|
|
|
#define MANAGEPROGRAM_H
|
|
|
|
|
|
|
|
#include "pageManager.h"
|
2019-08-13 16:59:01 +00:00
|
|
|
#include "parameterManager.h"
|
2019-07-06 18:47:29 +00:00
|
|
|
#include "accountManager.h"
|
2019-08-03 19:48:27 +00:00
|
|
|
|
2019-08-21 16:50:47 +00:00
|
|
|
#include <sys/types.h>
|
2019-08-15 12:20:06 +00:00
|
|
|
#include <pthread.h>
|
|
|
|
|
|
|
|
|
2019-08-17 14:06:33 +00:00
|
|
|
struct ThreadData
|
2019-08-15 12:20:06 +00:00
|
|
|
{
|
2019-08-17 14:06:33 +00:00
|
|
|
ThreadData(unsigned id, pthread_t init, std::string nameinUrl,int exitStateInit, Settings * settings, AccountManager * accountMg, PageManager * pM)
|
2019-08-16 18:12:25 +00:00
|
|
|
: id(id), thread(init), nameInUrl(nameinUrl), exitState(exitStateInit), settings(settings), accountManager(accountMg), pageManager(pM) {}
|
2019-08-16 11:32:13 +00:00
|
|
|
|
2019-08-15 12:20:06 +00:00
|
|
|
unsigned id;
|
|
|
|
pthread_t thread;
|
|
|
|
std::string nameInUrl, returnValue;
|
|
|
|
int staffel, folge, exitState;
|
|
|
|
Settings * settings;
|
|
|
|
AccountManager * accountManager;
|
|
|
|
PageManager * pageManager;
|
|
|
|
|
|
|
|
void * setState(int state) {
|
|
|
|
this->exitState = state;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
void setData(int staffel, int folge) { this->staffel = staffel; this->folge = folge; }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-08-15 10:50:27 +00:00
|
|
|
|
2019-07-06 18:47:29 +00:00
|
|
|
class ProgramManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProgramManager();
|
2019-08-03 16:23:12 +00:00
|
|
|
~ProgramManager();
|
2019-08-11 17:15:33 +00:00
|
|
|
int start(Settings *setting);
|
2019-08-03 19:48:27 +00:00
|
|
|
int listDir(std::string &list, std::string path, int maxDepth);
|
2019-07-06 18:47:29 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
int defaultModus(Settings * settings);
|
|
|
|
int directLinkModus(Settings * settings);
|
2019-10-10 15:39:57 +00:00
|
|
|
int searchModus(Settings * settings, std::string *saveTo = nullptr, bool noPrint = false);
|
2019-08-13 16:59:01 +00:00
|
|
|
int infoModus(Settings * settings);
|
2019-09-20 19:47:02 +00:00
|
|
|
int newsModus(Settings *settings);
|
2019-10-13 12:28:53 +00:00
|
|
|
int updateModus(Settings *settings);
|
2019-10-26 14:18:47 +00:00
|
|
|
int cleanUpSettingsAndCache(Settings *settings);
|
|
|
|
|
2019-07-06 18:47:29 +00:00
|
|
|
|
|
|
|
PageManager pageManager;
|
2019-08-17 14:06:33 +00:00
|
|
|
std::vector<ThreadData*> threadList;
|
2019-08-15 12:20:06 +00:00
|
|
|
unsigned nextThread;
|
2019-07-06 18:47:29 +00:00
|
|
|
|
|
|
|
int convertLink(std::string redirectLink, AccountManager *accountManager, Settings * settings, int Staffel = -1, int Folge = -1, std::string allLinks = "NOT_EMPTY");
|
2019-08-03 19:48:27 +00:00
|
|
|
int searchModus_update(Settings * settings);
|
2019-08-16 11:32:13 +00:00
|
|
|
int waitForThreads();
|
2019-08-22 17:56:22 +00:00
|
|
|
int sucheNach_1_Serien(Settings *settings, PageManager &pageManager, std::string &newName);
|
2019-10-04 18:11:01 +00:00
|
|
|
int checkLastUpdate(Settings * settings);
|
2019-08-16 11:32:13 +00:00
|
|
|
|
2019-07-06 18:47:29 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MANAGEPROGRAM_H
|