-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.cpp
More file actions
24 lines (19 loc) · 797 Bytes
/
user.cpp
File metadata and controls
24 lines (19 loc) · 797 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "user.h"
#include <iostream>
#include <string>
using namespace std;
class Library;
// int User::counter = 0;
// Constructor
User::User(int userId, const string &name, const string &password, const string &role, const string &email)
: userId(userId), name(name), password(password), role(role), email(email) {}
// Getters
int User::getUserId() const { return userId; }
string User::getName() const { return name; }
string User::getPassword() const { return password; }
string User::getRole() const { return role; }
string User::getEmail() const { return email; }
// Setters
void User::setName(const string &newName) { name = newName; }
void User::setPassword(const string &newPassword) { password = newPassword; }
void User::setEmail(const string &newEmail) { email = newEmail; }