forked from CodeWithKartik/BookMyShow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
User.h
39 lines (35 loc) · 888 Bytes
/
User.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 USER_H_INCLUDED
#define USER_H_INCLUDED
#include <iostream>
#include <cstring>
enum UserType {
GUEST = 0,
MEMBER,
ADMIN,
COUNT
};
class User {
protected:
long int userID;
const char *username;
char *password;
public:
User();
User(const char *uname, char *psswd);
User(const User &cpy);
virtual ~User();
//Getters
const long int GetUserID() const {return userID;}
const char *GetName() const {
return username;}
char *GetPsswd() const {return password;}
//Setters
void SetUserID(long int uid) {userID = uid;}
void SetPsswd(char *psswd) {
password = psswd;
}
virtual void ChangePassword(const char *old_psswd, const char *new_psswd);
bool IsPasswordCorrect(const char *psswd);
friend std::ostream& operator<<(std::ostream& os, const User *usr);
};
#endif // USER_H_INCLUDED