-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbmanager.h
39 lines (31 loc) · 1.05 KB
/
dbmanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef DBMANAGER_H
#define DBMANAGER_H
#include <QDebug>
#include <QSql>
#include <QFileInfo>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QDir>
#include <QFile>
#include "historyitem.h"
//manages all database interactions, initializing, reading and writing data
class DbManager
{
public:
static DbManager& getDbManager(); //returns the DbManager singleton
void addHistoryItem(const QString& fileName,
const QString& dateTime,
const double& compressionRatio,
const double& originalSize,
const double& compressedSize,
const double& executionTime,
const QString& notes);
void connectHistoryTable(const QString& path);//connects and initializes the SQLite database and the relevant table
void clearHistoryTable(); //clears the History table of all records
HistoryItem getHistoryItem(const int& id) const;
~DbManager();
private:\
DbManager();
};
#endif // DBMANAGER_H