You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
wdefs-importer/giantswdefimporter.h

42 lines
965 B

#ifndef GIANTSWDEFIMPORTER_H
#define GIANTSWDEFIMPORTER_H
#include <filesystem>
#include <QByteArray>
#include <QPushButton>
#include <QProcess>
namespace fs = std::filesystem;
class GiantsWdefImporter
{
public:
enum class StartResult {
SUCCESS,
FAILURE
};
GiantsWdefImporter();
fs::path askGiantsDirectory();
fs::path locateGiantsFolder();
void backupFile(fs::path const& path);
void revertFile(fs::path const& path);
void giantsFinished(fs::path const& giantsMainPath, fs::path const& wdefsPath, QPushButton* btn);
void setParent(QObject* parent);
int crc(QByteArray const& bytes);
QByteArray newExeBytes(QByteArray const& wdefsBytes, fs::path const& giantsMainPath);
StartResult startGiantsWithWdefsBytes(QByteArray const& wdefsBytes, fs::path const& wdefsPath, fs::path const& giantsMainPath, QPushButton* button);
private:
QObject* _parent { nullptr };
QProcess* _giantsMainProcess { nullptr };
};
#endif // GIANTSWDEFIMPORTER_H