-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.hpp
75 lines (66 loc) · 2.52 KB
/
task.hpp
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
69
70
71
72
73
74
75
#ifndef __TASK_HPP__
#define __TASK_HPP__
#include <vector>
#include <string>
#include "Date.hpp"
#include "Base.hpp"
#include "subtask.hpp"
using std::string;
using std::vector;
class task : public Base {
private:
string datestr;
//Date date;
int priority;
bool isComplete;
vector<subtask *> subs; // returns true if a task has subtasks
// private helper for mark_as_complete()
public:
task() : Base() {
this->set_date("");
//date = convert_date();
priority = 0;
isComplete = false;
}
task(string d, int p) : Base() {
this->set_date(d);
//date = convert_date();
priority = p;
isComplete = false;
}
task(string nm, string desc, string d, int p) : Base() { // for making new tasks from main
this->set_date(d);
this->setName(nm);
this->setDescription(desc);
datestr = d;
//date = convert_date();
priority = p;
isComplete = false;
}
task(string nm, string desc, string d, int p, bool c) : Base() { // task constructor for file i/o backup purposes
this->set_date(d);
this->setName(nm);
this->setDescription(desc);
//date = convert_date();
priority = p;
isComplete = c;
}
~task();
bool has_subtasks();
bool complete(); // returns current state of completion
vector<subtask*> get_subtasks();
//Date convert_date();
//string get_date();
//void set_date(string d);
int get_priority();
void set_priority(int p);
void mark_as_complete(); // sets current task to complete
void mark_as_incomplete(); // sets current task to inomplete
void add_subtask(subtask* sub); // pushes new subtask to subs vector (default)
void add_subtask(string nm, string d, int p); // pushes new subtask to subs vector (parameterized)
void complete_subtask(string nm); // mark a given subtask as complete
subtask* remove_subtask(string nm); // remove a given subtask and return
void print_subtasks(); // take a guess
subtask * search(string nm);
};
#endif