-
Notifications
You must be signed in to change notification settings - Fork 1
/
database.hpp
44 lines (37 loc) · 926 Bytes
/
database.hpp
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
#ifndef DATABASE_HPP
#define DATABASE_HPP
#include <iostream>
#include <regex>
#include <string>
#include <exception>
#include <boost/filesystem.hpp>
#include <pugixml.hpp>
#include "config.hpp"
#include "messenger.hpp"
#include "userdata.hpp"
class Database
{
private:
static Database* instance;
Messenger* msg;
std::string location;
std::string file_location;
QListWidget* wdList = nullptr;
std::vector<UserData> list;
Database();
Database(QListWidget *wdList);
void updateView();
void updateDatabase();
void loadData();
void setPath();
size_t indexOf(const std::string date);
public:
static Database* getInstance();
UserData getData(const int index);
void setView(QListWidget *wdList);
void addData(UserData data);
void editData(UserData Data);
void removeData(UserData data);
void removeData(const int index);
};
#endif //DATABASE_HPP