S_New4/programManager.h

63 lines
1.7 KiB
C
Raw Permalink Normal View History

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>
#include <dirent.h>
#include <pthread.h>
struct ThreadData
{
ThreadData(unsigned id, pthread_t init, std::string nameinUrl,int exitStateInit, Settings * settings, AccountManager * accountMg, PageManager * pM)
: id(id), thread(init), nameInUrl(nameinUrl), exitState(exitStateInit), settings(settings), accountManager(accountMg), pageManager(pM) {}
2019-08-16 11:32:13 +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();
~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);
int searchModus(Settings * settings, std::string *saveTo = nullptr);
2019-08-13 16:59:01 +00:00
int infoModus(Settings * settings);
2019-07-06 18:47:29 +00:00
PageManager pageManager;
std::vector<ThreadData*> threadList;
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();
int sucheNach_1_Serien(Settings *settings, PageManager &pageManager, std::string &newName);
2019-08-16 11:32:13 +00:00
2019-07-06 18:47:29 +00:00
};
#endif // MANAGEPROGRAM_H