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

Commit

Permalink
fix students_classes.csv
Browse files Browse the repository at this point in the history
  • Loading branch information
guilherme-ds-matos committed Nov 2, 2023
1 parent 6c8aaaf commit eb7d115
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions schedule/students_classes.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
StudentCode,StudentName,UcCode,ClassCode
202025232,Iara,L.EIC002,1LEIC05
StudentCode,StudentName,UcCode,ClassCode
2020252�2,Iara,L.EIC002,1LEIC05
202031607,Gisela,L.EIC004,1LEIC08
202031607,Gisela,L.EIC005,1LEIC08
202079037,Jose Jesualdo,L.EIC023,3LEIC08
Expand Down
6 changes: 4 additions & 2 deletions src/CSVStudentsClasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <algorithm>
#include <fstream>
#include <iostream>
#include <ostream>
#include <sstream>
#include <string>
#include <vector>
Expand All @@ -30,11 +31,12 @@ CSVStudentsClasses::CSVStudentsClasses(const std::string &csv) {
std::string line;
this->entries = std::vector<StudentsClasses>();
if (!getline(s, line, '\n')) {
std::cerr << "ERROR: CRITICAL: INVALID FILE CSVSTUDENTCLASSES" << std::endl;
std::cerr << "ERROR: CRITICAL: INVALID FILE CSVSTUDENTCLASSES(0)" << std::endl;
std::exit(1);
}
if (line != "StudentCode,StudentName,UcCode,ClassCode") {
std::cerr << "ERROR: CRITICAL: INVALID FILE CSVSTUDENTCLASSES" << std::endl;
std::cout << line <<" != " << std::string("StudentCode,StudentName,UcCode,ClassCode") << std::endl;
std::cerr << "ERROR: CRITICAL: INVALID FILE CSVSTUDENTCLASSES(1)" << std::endl;
std::exit(1);
}
line.clear();
Expand Down

0 comments on commit eb7d115

Please sign in to comment.