-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.cpp
More file actions
36 lines (30 loc) · 1.12 KB
/
Copy pathUser.cpp
File metadata and controls
36 lines (30 loc) · 1.12 KB
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
#include "User.h"
#include <string>
using namespace std;
//CONSTRUCTORS********************************************************************
User::User() { }
User::User(string mname, string mpassword) { name = mname; password = mpassword; }
User::User(string mname, string mpassword, bool mloggedIn, int mfd)
{
name = mname;
password = mpassword;
loggedIn = mloggedIn;
fd = mfd;
}
//SETTERS*************************************************************************
void User::setName(string new_name) { name = new_name; }
void User::setPassword(string new_password) { password = new_password; }
void User::setLoggedIn(bool new_loggedIn) { loggedIn = new_loggedIn; }
void User::setfd(int newfd) { fd = newfd; }
//GETTERS*************************************************************************
string User::getName() { return name; }
string User::getPassword() { return password; }
int User::getfd() { return fd; }
bool User::isLoggedIn() { return loggedIn; }
//METHODS*************************************************************************
bool User::legalName() {
if(name.find(" ") == name.npos)
return true;
else
return false;
}