-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.cpp
48 lines (39 loc) · 809 Bytes
/
user.cpp
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
#include "user.h"
User::User(const std::string& name, const std::string& username,const std::string& password)
{
m_name = name;
m_username = username;
m_password = password;
}
const std::string &User::getName() const
{
return m_name;
}
const std::string &User::getPassword() const
{
return m_password;
}
const std::string& User::getUsername() const
{
return m_username;
}
void User::setName(const std::string &name)
{
m_name = name;
}
void User::setPassword(const std::string &password)
{
m_password = password;
}
void User::setUsername(const std::string& username)
{
m_username = username;
}
void User::addProduct(const Product &newProduct)
{
m_products.push_back(newProduct);
}
const std::vector<Product> &User::getProduct() const
{
return m_products;
}