void makeCourseVector(vector<string> a , vector<course*> &V){ int size = a.size(); for (int i = 0 ; i < size && a[i] != "" ; i++){ course* c = readCourse(a[i]); V.push_back(c); } }
void TcxReader::readCourses() { Q_ASSERT(isStartElement() && name() == "Courses"); while (!atEnd()) { readNext(); if (isEndElement()) break; if (isStartElement()) { if (name() == "Course") { readCourse(); } /* else if (name() == "Author") { readAuthor(); } */ else readUnknownElement(); } } }
void readFile(student_node *studentList, teacher_node *teacherList, course_node *courseList, enrollment_node *enrollmentList, assignment_node *assignmentList) { FILE *fp; char *s = malloc(sizeof(char)*limit); fp = fopen("textFile.txt", "r"); if (fp != NULL) { while (fgets(s, limit-1, fp) != NULL) { switch (s[0]) { case 'S' : readStudent(studentList, s); break; case 'T' : readTeacher(teacherList, s); break; case 'E' : readEnrollments(enrollmentList, studentList, courseList, s); break; case 'A' : readAssignmnet(assignmentList, teacherList, courseList, s); break; case 'C' : readCourse(courseList, s); break; } } fclose(fp); }else{ perror("text file not found"); } }