-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask.cpp
More file actions
68 lines (56 loc) · 1.39 KB
/
Copy pathtask.cpp
File metadata and controls
68 lines (56 loc) · 1.39 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
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
#include "task.h"
// Constructors
Task::Task() : name(""), priority(0), description(""), status(UNFINISHED) {}
Task::Task(const std::string &name, int priority, const std::string &description, Status status)
: name(name), priority(priority), description(description), status(status) {}
Task::Task(const Task &taskToCopy) : name(taskToCopy.name),
priority(taskToCopy.priority),
description(taskToCopy.description),
status(taskToCopy.status)
{
}
Task &Task::operator=(const Task &taskToCopy)
{
if (this != &taskToCopy)
{
name = taskToCopy.name;
priority = taskToCopy.priority;
description = taskToCopy.description;
status = taskToCopy.status;
}
return *this;
}
// Getter functions
std::string Task::getName() const
{
return name;
}
int Task::getPriority() const
{
return priority;
}
std::string Task::getDescription() const
{
return description;
}
Task::Status Task::getStatus() const
{
return status;
}
// Setter functions
void Task::setName(const std::string &newName)
{
name = newName;
}
void Task::setPriority(int newPriority)
{
priority = newPriority;
}
void Task::setDescription(const std::string &newDescription)
{
description = newDescription;
}
void Task::setStatus(Status newStatus)
{
status = newStatus;
}