2019-04-16 08:50:08 +02:00
|
|
|
#ifndef FILESAVER_H
|
|
|
|
#define FILESAVER_H
|
|
|
|
#include <QSqlDatabase>
|
|
|
|
#include <QFileInfo>
|
2023-01-08 17:37:28 +01:00
|
|
|
#include "filesaveroptions.h"
|
2019-04-16 08:50:08 +02:00
|
|
|
#include "pagedata.h"
|
|
|
|
#include "filedata.h"
|
|
|
|
#include "sqlitedbservice.h"
|
2022-05-29 15:46:06 +02:00
|
|
|
#include "common.h"
|
2019-04-16 08:50:08 +02:00
|
|
|
class FileSaver
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
SqliteDbService *dbService;
|
2022-05-29 15:46:06 +02:00
|
|
|
QStringList excludedPaths = Common::excludedPaths();
|
2023-01-08 17:37:28 +01:00
|
|
|
FileSaverOptions fileSaverOptions;
|
2019-04-16 08:50:08 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
FileSaver(SqliteDbService &dbService);
|
2022-04-14 15:01:25 +02:00
|
|
|
SaveFileResult addFile(QString path);
|
|
|
|
SaveFileResult updateFile(QString path);
|
2019-04-16 08:50:08 +02:00
|
|
|
SaveFileResult saveFile(const QFileInfo &fileInfo);
|
2023-01-08 17:37:28 +01:00
|
|
|
int processFiles(const QVector<QString> paths, std::function<SaveFileResult(QString path)> saverFunc);
|
|
|
|
int addFiles(const QVector<QString> paths);
|
|
|
|
int updateFiles(const QVector<QString> paths);
|
|
|
|
|
|
|
|
void setFileSaverOptions(FileSaverOptions options)
|
|
|
|
{
|
|
|
|
this->fileSaverOptions = options;
|
|
|
|
}
|
2019-04-16 08:50:08 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FILESAVER_H
|