cli: Move most classes to shared lib for reuse
Šī revīzija ir iekļauta:
33
shared/sqlitedbservice.h
Parasts fails
33
shared/sqlitedbservice.h
Parasts fails
@ -0,0 +1,33 @@
|
||||
#ifndef SQLITEDBSERVICE_H
|
||||
#define SQLITEDBSERVICE_H
|
||||
#include <QFileInfo>
|
||||
#include "databasefactory.h"
|
||||
#include "utils.h"
|
||||
#include "pagedata.h"
|
||||
#include "filedata.h"
|
||||
#include "../shared/sqlitesearch.h"
|
||||
#include "../shared/token.h"
|
||||
enum SaveFileResult
|
||||
{
|
||||
OK,
|
||||
SKIPPED,
|
||||
DBFAIL,
|
||||
PROCESSFAIL
|
||||
};
|
||||
|
||||
class SqliteDbService
|
||||
{
|
||||
private:
|
||||
DatabaseFactory *dbFactory = nullptr;
|
||||
|
||||
public:
|
||||
SqliteDbService(DatabaseFactory &dbFactory);
|
||||
SaveFileResult saveFile(QFileInfo fileInfo, QVector<PageData> &pageData);
|
||||
int getFiles(QVector<FileData> &results, QString wildCardPattern, int offset, int limit);
|
||||
bool deleteFile(QString path);
|
||||
bool fileExistsInDatabase(QString path);
|
||||
bool fileExistsInDatabase(QString path, qint64 mtime);
|
||||
QVector<SearchResult> search(const LooqsQuery &query);
|
||||
};
|
||||
|
||||
#endif // SQLITEDBSERVICE_H
|
Atsaukties uz šo jaunā problēmā
Block a user