This commit is contained in:
朱子楚\zhuzi
2024-04-03 11:09:35 +08:00
parent 7d1666597f
commit bf5bedc9ed
11 changed files with 71 additions and 73 deletions

View File

@ -0,0 +1,26 @@
#ifndef INITIALIZRHELPER_H
#define INITIALIZRHELPER_H
#include <QObject>
#include <QtQml/qqml.h>
#include <QDir>
#include "src/singleton.h"
class InitializrHelper : public QObject
{
Q_OBJECT
private:
explicit InitializrHelper(QObject* parent = nullptr);
bool copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists = true);
void copyFile(const QString& source,const QString& dest);
template <typename...Args>
void templateToFile(const QString& source,const QString& dest,Args &&...args);
public:
SINGLETON(InitializrHelper)
~InitializrHelper() override;
Q_INVOKABLE void generate(const QString& name,const QString& path);
Q_SIGNAL void error(const QString& message);
Q_SIGNAL void success(const QString& path);
};
#endif // INITIALIZRHELPER_H