cli: Move most classes to shared lib for reuse

Šī revīzija ir iekļauta:
2022-03-18 22:33:45 +01:00
vecāks d43c35819d
revīzija 478d57b342
33 mainīti faili ar 32 papildinājumiem un 44 dzēšanām

29
shared/filesaver.h Parasts fails
Parādīt failu

@@ -0,0 +1,29 @@
#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);
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);
;
};
#endif // FILESAVER_H