Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 854c06b

Browse files
committed
First implementation of cap
1 parent e093055 commit 854c06b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

main.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@
1010
#include <string>
1111

1212
int main(int argc, char** argv) {
13+
int cap = 30;
14+
1315
// AppClassesPerUC
1416
std::ifstream file1 = std::ifstream("schedule/classes_per_uc.csv");
1517
std::string contents1;
1618
std::ostringstream sstr1;
1719
sstr1 << file1.rdbuf();
1820
contents1 = sstr1.str();
19-
AppClassPerUC cpu = AppClassPerUC(contents1);
21+
AppClassPerUC cpu = AppClassPerUC(contents1, cap);
2022
cpu.display();
2123

2224
// AppStudentsClasses

src/appClassesPerUC.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
#include <algorithm>
66
#include <fstream>
77

8-
AppClassPerUC::AppClassPerUC(std::string csv) {
8+
AppClassPerUC::AppClassPerUC(std::string csv, int cap) {
9+
this->cap = cap;
10+
911
std::stringstream s(csv);
1012
std::string line;
1113
this->entries = std::vector<ClassPerUC>();

src/appClassesPerUC.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ class AppClassPerUC {
77
std::string uc_cath_name;
88
std::string class_cath_name;
99
std::vector<ClassPerUC> entries;
10+
int cap;
1011

1112
public:
12-
AppClassPerUC(std::string csv);
13+
AppClassPerUC(std::string csv, int cap);
1314
~AppClassPerUC();
1415
void display();
1516
void sort_by(std::string category);

0 commit comments

Comments
 (0)