2019-04-16 08:49:02 +02:00
|
|
|
#ifndef SQLITEDBSERVICE_H
|
|
|
|
#define SQLITEDBSERVICE_H
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include "databasefactory.h"
|
|
|
|
#include "utils.h"
|
|
|
|
#include "pagedata.h"
|
|
|
|
#include "filedata.h"
|
2019-04-22 22:00:40 +02:00
|
|
|
#include "../shared/sqlitesearch.h"
|
2019-08-17 11:06:35 +02:00
|
|
|
#include "../shared/token.h"
|
2019-04-16 08:49:02 +02:00
|
|
|
enum SaveFileResult
|
|
|
|
{
|
|
|
|
OK,
|
|
|
|
SKIPPED,
|
|
|
|
DBFAIL,
|
2022-04-14 15:00:59 +02:00
|
|
|
PROCESSFAIL,
|
|
|
|
NOTFOUND
|
2019-04-16 08:49:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class SqliteDbService
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
DatabaseFactory *dbFactory = nullptr;
|
|
|
|
|
|
|
|
public:
|
|
|
|
SqliteDbService(DatabaseFactory &dbFactory);
|
|
|
|
SaveFileResult saveFile(QFileInfo fileInfo, QVector<PageData> &pageData);
|
2022-06-03 10:04:43 +02:00
|
|
|
unsigned int getFiles(QVector<FileData> &results, QString wildCardPattern, int offset, int limit);
|
2019-04-16 08:49:02 +02:00
|
|
|
bool deleteFile(QString path);
|
|
|
|
bool fileExistsInDatabase(QString path);
|
|
|
|
bool fileExistsInDatabase(QString path, qint64 mtime);
|
2021-06-12 14:59:58 +02:00
|
|
|
QVector<SearchResult> search(const LooqsQuery &query);
|
2019-04-16 08:49:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SQLITEDBSERVICE_H
|