-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patholop.hpp
More file actions
70 lines (62 loc) · 2.3 KB
/
olop.hpp
File metadata and controls
70 lines (62 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef OLOP_HPP
#define OLOP_HPP
#include "mainwindow.h"
#include "qhttpserver.h"
#include <QWebEnginePage>
#include <QtCore>
// Fichier des actions principales d'Olop
class MAIN {
public:
~MAIN();
static const QString HOME;
static QString VERSION;
static const QString O_DIR;
static const QString APP_DIR;
static QHttpServer httpServer;
static MainWindow* w;
static QString osname;
static int mode;
static bool ecrireDansFichier(const QString& cheminFichier, const QByteArray& contenu);
static bool ecrireDansFichier(const QString& cheminFichier, const QString& contenu);
static bool INIT(int mode=0);
static int SERVER(QString ports);
static void executeInMainThread(std::function<void()> func);
static bool isVersionGreater(const QString& newVersion, const QString& oldVersion);
static bool copyFile(const QString& sourceFilePath, const QString& destinationFilePath);
static bool moveFile(const QString& sourceFilePath, const QString& destinationFilePath);
static bool deleteFile(const QString& filePath);
static bool supprimerDossier(const QString& cheminDossier);
static bool mkdir(QString path);
static QStringList getListOfFilesInDirectory(const QString& directoryPath, bool includesubdir=false, bool includeDirs = false);
static QByteArray lireFichier(const QString& cheminFichier);
static QString detectLanguageJS(QWebEnginePage* page);
static bool Exit(int code);
static bool ReportCrash(int exitcode, QString log);
};
class APP {
public:
~APP();
static QStringList decodeApp(const QString data);
static QStringList decodeApp(const QByteArray data);
static QString LIST(const QString& directoryPath);
static int HTTPSERVER(QString dir);
static QList<QHttpServer*> httpServers;
};
class NETWORK {
public:
static bool checkURLAccess(const QString& url);
static int findAvailablePort();
static QByteArray Download(const QUrl Url);
static QString port;
#ifdef Q_OS_LINUX
static int goalpha();
#endif
};
class FILES {
public:
static bool unZip(const QString &file, const QString &dest, std::function<void()> cleaningCallback = nullptr);
static int gocurrentdirandcheckpermissions();
static QString getcurrentdir();
static int checkpermission(QString path);
};
#endif // OLOP_HPP