-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathUsers.h
70 lines (58 loc) · 1.54 KB
/
Users.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma clang diagnostic push
#pragma ide diagnostic ignored "modernize-use-nodiscard"
#ifndef CTDL_GK_USERS_H
#define CTDL_GK_USERS_H
#include <string>
#include <vector>
#include "LinkedList.cpp"
#include "UserData.h"
#include "CsvFile.h"
/**
* @class Users
* @brief Class for Users
* @details This class contains functions for Users
*/
class Users {
private:
LinkedList<UserData> _list;
public:
Users();
~Users();
/**
* @brief Add user to list
* @param user User to add
* @return True if success, false if failed
*/
bool addUser(const UserData& user);
/**
* @brief Remove user from list
* @param userName Username of user to remove
* @return True if success, false if failed
*/
bool removeUser(const std::string& userName);
/**
* @brief Edit user in list
* @param userName Username of user to edit
* @param user New user data
* @return True if success, false if failed
*/
bool editUser(const std::string& userName, const UserData& user);
/**
* @brief Search user in list
* @param userName Username of user to search
* @return Index of user in list if found, -1 if not found
*/
int searchUser(const std::string& userName) const;
/**
* @brief List all users
* @return List of users
*/
std::vector<UserData> listUsers() const;
/**
* @brief Import user data from file
* @return True if success, false if failed
*/
bool importUserData();
};
#endif //CTDL_GK_USERS_H
#pragma clang diagnostic pop