Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void sync_progress_file() {
- set<string> login_students_file;
- vector<string> users_in_progress_file;
- set<string> users_in_progress_file_set;
- ifstream students_file;
- students_file.open(MARK_BY_TOPIC_FILE);
- if (students_file.is_open()) {
- string line;
- int curr_index = 0;
- while (getline(students_file, line)) {
- if (curr_index % LOGIN_LINE_PERIOD_IN_STUDENTS_FILE == 0) {
- string subbed_login = line.substr(2, line.length());
- login_students_file.insert(subbed_login);
- }
- curr_index++;
- }
- }
- students_file.close();
- ifstream progress_file;
- progress_file.open(PROGRESS_FILE);
- if (progress_file.is_open()) {
- string line;
- int curr_index = 0;
- while (getline(progress_file, line)) {
- if (curr_index % LOGIN_LINE_PERIOD_IN_PROGRESSS_FILE == 0) {
- users_in_progress_file.push_back(line);
- users_in_progress_file_set.insert(line);
- }
- curr_index++;
- }
- }
- progress_file.close();
- if()
- for (string login : users_in_progress_file) {
- if (login_students_file.count(login) <= 0) {
- }
- else {
- cout << "Contains " << login << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement