-
Notifications
You must be signed in to change notification settings - Fork 1
/
db.h
executable file
·46 lines (26 loc) · 1.18 KB
/
db.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
40
41
42
43
44
45
46
#ifndef DB_H
#define DB_H
#include <QtSql>
#include <iostream>
#include "user.h"
#include "DocumentEntity.h"
#include "documentmessage.h"
void addUser(QSqlQuery &q, User &user);
bool signUser(QSqlDatabase db,User &user);
int checkCredentials(QSqlQuery &q, User &user);
bool loginUser (QSqlDatabase db,User &user);
bool updateImgUser (QSqlDatabase db, User &user , QByteArray &newImg);
bool updateNameUser (QSqlDatabase db, User &user , QString &newName);
bool updateSurnameUser (QSqlDatabase db, User &user , QString &newSurname);
bool updatePasswordUser (QSqlDatabase db, User &user , QString &newPass);
bool addDocument(QSqlDatabase db, DocumentEntity &document);
bool findDocumentById(QSqlDatabase db, DocumentEntity &document);
int findDocumentByOwner(QSqlDatabase db, QVector<DocumentEntity> &documents, QString ownerEmail);
bool deleteFile(QSqlDatabase db,DocumentMessage dm);
QSqlError populateUsersTable();
QSqlError initDb(QString& hostname, QString& dbname, QString& port, QString& username, QString& password);
QSqlDatabase startDb();
void closeDb(QSqlDatabase db);
void setDocumentsDirectory(QString dir);
QString documentIdToDocumentPath(QUuid documentId);
#endif // DB_H