2019-04-16 08:50:08 +02:00
|
|
|
#ifndef FILESAVER_H
|
|
|
|
#define FILESAVER_H
|
|
|
|
#include <QSqlDatabase>
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include "pagedata.h"
|
|
|
|
#include "filedata.h"
|
|
|
|
#include "sqlitedbservice.h"
|
|
|
|
|
|
|
|
class FileSaver
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
SqliteDbService *dbService;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
SaveFileResult addFile(QString path);
|
|
|
|
SaveFileResult updateFile(QString path);
|
|
|
|
|
|
|
|
public:
|
|
|
|
FileSaver(SqliteDbService &dbService);
|
|
|
|
SaveFileResult saveFile(const QFileInfo &fileInfo);
|
2019-04-26 22:46:33 +02:00
|
|
|
int processFiles(const QVector<QString> paths, std::function<SaveFileResult(QString path)> saverFunc,
|
|
|
|
bool keepGoing, bool verbose);
|
|
|
|
int addFiles(const QVector<QString> paths, bool keepGoing, bool verbose);
|
|
|
|
int updateFiles(const QVector<QString> paths, bool keepGoing, bool verbose);
|
2019-04-16 08:50:08 +02:00
|
|
|
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FILESAVER_H
|