Advertisement
Kostiggig

Untitled

Apr 15th, 2023
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.35 KB | None | 0 0
  1. void sync_progress_file() {
  2.     set<string> login_students_file;
  3.     vector<string> users_in_progress_file;
  4.     set<string> users_in_progress_file_set;
  5.    
  6.     ifstream students_file;
  7.     students_file.open(MARK_BY_TOPIC_FILE);
  8.  
  9.     if (students_file.is_open()) {
  10.         string line;
  11.         int curr_index = 0;
  12.         while (getline(students_file, line)) {
  13.             if (curr_index % LOGIN_LINE_PERIOD_IN_STUDENTS_FILE == 0) {
  14.                 string subbed_login = line.substr(2, line.length());
  15.                 login_students_file.insert(subbed_login);
  16.             }
  17.             curr_index++;
  18.         }
  19.     }
  20.  
  21.     students_file.close();
  22.  
  23.     ifstream progress_file;
  24.     progress_file.open(PROGRESS_FILE);
  25.  
  26.     if (progress_file.is_open()) {
  27.         string line;
  28.         int curr_index = 0;
  29.         while (getline(progress_file, line)) {
  30.             if (curr_index % LOGIN_LINE_PERIOD_IN_PROGRESSS_FILE == 0) {
  31.                 users_in_progress_file.push_back(line);
  32.                 users_in_progress_file_set.insert(line);
  33.             }
  34.             curr_index++;
  35.         }
  36.     }
  37.     progress_file.close();
  38.  
  39.     if()
  40.  
  41.     for (string login : users_in_progress_file) {
  42.         if (login_students_file.count(login) <= 0) {
  43.            
  44.         }
  45.         else {
  46.             cout << "Contains " << login << endl;
  47.         }
  48.     }
  49.    
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement