#ifndef SQLITEDBSERVICE_H #define SQLITEDBSERVICE_H #include #include #include "databasefactory.h" #include "utils.h" #include "pagedata.h" #include "filedata.h" #include "../shared/sqlitesearch.h" #include "../shared/token.h" #include "savefileresult.h" class SqliteDbService { private: DatabaseFactory *dbFactory = nullptr; bool insertToFTS(bool useTrigrams, QSqlDatabase &db, int fileid, QVector &pageData); public: SqliteDbService(DatabaseFactory &dbFactory); SaveFileResult saveFile(QFileInfo fileInfo, QVector &pageData); unsigned int getFiles(QVector &results, QString wildCardPattern, int offset, int limit); bool deleteFile(QString path); bool fileExistsInDatabase(QString path); bool fileExistsInDatabase(QString path, qint64 mtime); QVector search(const LooqsQuery &query); std::optional queryFileType(QString absPath); }; #endif // SQLITEDBSERVICE_H