-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGradePage.h
56 lines (48 loc) · 1.23 KB
/
GradePage.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef GRADE_PAGE_H
#define GRADE_PAGE_H
#include "Page.h"
#include <list>
#include <vector> //for holding args of courses - used only in constructing
#include <string.h>
#include "Course.h"
using namespace std;
/**
* Usage: to be able to create a GradePage obj, you will need
* to do so by using the createGradeClass method.
*
* ex: GradePage* gp = GradePage::createGradeClass(*recieverPage);
*
* that is why that method is *static*.
* you cannot use new.
*
* if something went wrong while the creation of this class, debug
* it via the output in the Terminal.
*
*
* 2014.
* Sagi Dayan
*/
class GradePage : public Page
{
public:
static GradePage* createGradeClass(string& html);
~GradePage();
list<Course*> getList();
int getRows(){return rowSize;}
int getCols(){return colSize;}
int CoursesAmount() { return courses.size(); }
void printCourses();
double getAvg();
private:
GradePage(string& html);
void genList();
list<Course*> courses;
int rowSize, colSize;
void tokenToLines();
void tokenToCourseArgs(string& line, bool& first);
void linkCourse();
//these vectors are "global" for convenience... while constructing they will be killed.
vector<string> lines;
vector<string> courseArgs;
};
#endif